ปรับ Code เคื่องราช
This commit is contained in:
parent
51d072ccc0
commit
240862be2c
13 changed files with 548 additions and 885 deletions
|
|
@ -1,106 +1,4 @@
|
||||||
<template>
|
|
||||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
|
||||||
<div class="toptitle col-12 row items-center">
|
|
||||||
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="clickBack" />
|
|
||||||
{{
|
|
||||||
edit
|
|
||||||
? "รอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
|
|
||||||
: "เพิ่มรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
<q-form ref="myForm">
|
|
||||||
<div class="col-12">
|
|
||||||
<q-card bordered>
|
|
||||||
<div class="col-12 row q-col-gutter-md q-pa-md">
|
|
||||||
<div class="col-xs-12 col-sm-12 row">
|
|
||||||
<q-separator />
|
|
||||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
|
||||||
<q-select class="col-10" dense outlined v-model="roundInsig" :options="options" option-value="value"
|
|
||||||
option-label="label" label="รอบการเสนอขอพระราชทานเครื่องราชฯ" @update:model-value="updateDateRange"
|
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกรอบที่'}`]" />
|
|
||||||
<datepicker menu-class-name="modalfix" v-model="yearly" class="col-2" :locale="'th'" autoApply year-picker
|
|
||||||
:enableTimePicker="false" @update:modelValue="updateYear">
|
|
||||||
<template #year="{ year }">{{ year + 543 }}</template>
|
|
||||||
<template #year-overlay-value="{ value }">{{
|
|
||||||
parseInt(value + 543)
|
|
||||||
}}</template>
|
|
||||||
<template #trigger>
|
|
||||||
<q-input dense lazy-rules outlined :model-value="yearly + 543"
|
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกปีที่เสนอ'}`]" :label="`${'ปีที่เสนอ'}`">
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
|
|
||||||
</q-icon>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
</template>
|
|
||||||
</datepicker>
|
|
||||||
<datepicker menu-class-name="modalfix" v-model="dateStart" :locale="'th'" autoApply
|
|
||||||
class="col-xs-12 col-sm-5" borderless :enableTimePicker="false" week-start="0">
|
|
||||||
<template #year="{ year }">
|
|
||||||
{{ year + 543 }}
|
|
||||||
</template>
|
|
||||||
<template #year-overlay-value="{ value }">
|
|
||||||
{{ parseInt(value + 543) }}
|
|
||||||
</template>
|
|
||||||
<template #trigger>
|
|
||||||
<q-input outlined dense class="full-width datepicker" :model-value="dateStart != null ? date2Thai(dateStart) : null
|
|
||||||
" :label="`${'วันเริ่มต้น'}`" :rules="[(val) => !!val || `${'กรุณาเลือกวันเริ่มต้น'}`]">
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
|
|
||||||
</q-icon>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
</template>
|
|
||||||
</datepicker>
|
|
||||||
<datepicker menu-class-name="modalfix" v-model="dateEnd" class="col-xs-12 col-sm-5" :locale="'th'"
|
|
||||||
autoApply borderless :enableTimePicker="false" week-start="0">
|
|
||||||
<template #year="{ year }">
|
|
||||||
{{ year + 543 }}
|
|
||||||
</template>
|
|
||||||
<template #year-overlay-value="{ value }">
|
|
||||||
{{ parseInt(value + 543) }}
|
|
||||||
</template>
|
|
||||||
<template #trigger>
|
|
||||||
<q-input outlined dense class="col-xs-12 col-sm-4"
|
|
||||||
:model-value="dateEnd != null ? date2Thai(dateEnd) : null" :label="`${'วันสิ้นสุด'}`" :rules="[
|
|
||||||
(val) => !!val || `${'กรุณาเลือกวันที่วันสิ้นสุด'}`,
|
|
||||||
]">
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
|
|
||||||
</q-icon>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
</template>
|
|
||||||
</datepicker>
|
|
||||||
|
|
||||||
<q-input class="col-xs-12 col-sm-2" dense outlined v-model="datelast"
|
|
||||||
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด" />
|
|
||||||
<q-file class="col-xs-12 col-sm-10" outlined dense v-model="files" @added="fileUploadDoc"
|
|
||||||
label="อัปโหลดเอกสารประกอบ" hide-bottom-space lazy-rules>
|
|
||||||
<!-- :rules="[
|
|
||||||
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
|
|
||||||
]" -->
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<q-icon name="attach_file" />
|
|
||||||
</template>
|
|
||||||
</q-file>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<q-separator />
|
|
||||||
<q-separator />
|
|
||||||
<div class="row col-12 q-pa-sm">
|
|
||||||
<q-space />
|
|
||||||
<q-btn unelevated dense class="q-px-md items-center" color="light-blue-10" label="บันทึก"
|
|
||||||
@click="checkSave" />
|
|
||||||
</div>
|
|
||||||
</q-card>
|
|
||||||
</div>
|
|
||||||
</q-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { QTableProps } from "quasar";
|
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useQuasar, QForm } from "quasar";
|
import { useQuasar, QForm } from "quasar";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
|
|
@ -111,12 +9,12 @@ import config from "@/app.config";
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
success,
|
|
||||||
dateToISO,
|
dateToISO,
|
||||||
messageError,
|
messageError,
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
|
success,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
@ -138,18 +36,14 @@ const options = ref([
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchData();
|
await fetchData();
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
if (route.params.id) {
|
if (route.params.id) {
|
||||||
edit.value = true;
|
edit.value = true;
|
||||||
showLoader();
|
showLoader();
|
||||||
// console.log(id.value);
|
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.getRoundInsignia(id.value))
|
.get(config.API.getRoundInsignia(id.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
// const files = res.data.result.files;
|
|
||||||
id.value = data.period_id;
|
id.value = data.period_id;
|
||||||
roundInsig.value =
|
roundInsig.value =
|
||||||
options.value.filter((r: any) => r.value == data.period_round)
|
options.value.filter((r: any) => r.value == data.period_round)
|
||||||
|
|
@ -171,8 +65,6 @@ const fetchData = async () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const routeName = router.currentRoute.value.name;
|
|
||||||
|
|
||||||
const fileUploadDoc = async (files: any) => {
|
const fileUploadDoc = async (files: any) => {
|
||||||
files.forEach((file: any) => {
|
files.forEach((file: any) => {
|
||||||
fileDocDataUpload.value.push(file);
|
fileDocDataUpload.value.push(file);
|
||||||
|
|
@ -185,7 +77,9 @@ const updateYear = async (e: number) => {
|
||||||
|
|
||||||
const editData = async (id: string) => {
|
const editData = async (id: string) => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${roundInsig.value.value} ปี ${yearly.value + 543}`;
|
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||||
|
roundInsig.value.value
|
||||||
|
} ปี ${yearly.value + 543}`;
|
||||||
formData.append("name", name);
|
formData.append("name", name);
|
||||||
formData.append("year", yearly.value.toString());
|
formData.append("year", yearly.value.toString());
|
||||||
formData.append("amount", datelast.value.toString());
|
formData.append("amount", datelast.value.toString());
|
||||||
|
|
@ -196,15 +90,12 @@ const editData = async (id: string) => {
|
||||||
if (dateEnd.value !== null) {
|
if (dateEnd.value !== null) {
|
||||||
formData.append("endDate", dateToISO(dateEnd.value));
|
formData.append("endDate", dateToISO(dateEnd.value));
|
||||||
}
|
}
|
||||||
// files.value.forEach((file: any) => {
|
|
||||||
// formData.append("file", file);
|
|
||||||
// });
|
|
||||||
formData.append("file", files.value);
|
formData.append("file", files.value);
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.put(config.API.editRoundInsignia(id), formData)
|
.put(config.API.editRoundInsignia(id), formData)
|
||||||
.then(async () => { })
|
.then(async () => {})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
|
|
@ -231,19 +122,7 @@ const SaveData = async () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// const sendData = () => {
|
|
||||||
// const valueData: any = {
|
|
||||||
// Name: roundInsig.value,
|
|
||||||
// year: year.value,
|
|
||||||
// Amount: datelast.value,
|
|
||||||
// dateStart: dateStart.value !== null ? dateToISO(dateStart.value) : null,
|
|
||||||
// dateEnd: dateEnd.value !== null ? dateToISO(dateEnd.value) : null,
|
|
||||||
// };
|
|
||||||
// return valueData;
|
|
||||||
// };
|
|
||||||
const updateDateRange = () => {
|
const updateDateRange = () => {
|
||||||
// console.log("test")
|
|
||||||
if (roundInsig.value.value == 1) {
|
if (roundInsig.value.value == 1) {
|
||||||
dateStart.value = new Date(new Date().getFullYear(), 9, 1);
|
dateStart.value = new Date(new Date().getFullYear(), 9, 1);
|
||||||
dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29);
|
dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29);
|
||||||
|
|
@ -257,8 +136,9 @@ const updateDateRange = () => {
|
||||||
|
|
||||||
const addData = async () => {
|
const addData = async () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${roundInsig.value.value
|
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||||
} ปี ${yearly.value + 543} `;
|
roundInsig.value.value
|
||||||
|
} ปี ${yearly.value + 543} `;
|
||||||
console.log(name);
|
console.log(name);
|
||||||
formData.append("name", name);
|
formData.append("name", name);
|
||||||
formData.append("year", yearly.value.toString());
|
formData.append("year", yearly.value.toString());
|
||||||
|
|
@ -270,17 +150,14 @@ const addData = async () => {
|
||||||
if (dateEnd.value !== null) {
|
if (dateEnd.value !== null) {
|
||||||
formData.append("endDate", dateToISO(dateEnd.value));
|
formData.append("endDate", dateToISO(dateEnd.value));
|
||||||
}
|
}
|
||||||
console.log(files.value);
|
|
||||||
// files.value.forEach((file: any) => {
|
|
||||||
// formData.append("file", file);
|
|
||||||
// });
|
|
||||||
formData.append("file", files.value);
|
formData.append("file", files.value);
|
||||||
console.log(files.value);
|
|
||||||
|
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.post(config.API.listRoundInsignia(), formData)
|
.post(config.API.listRoundInsignia(), formData)
|
||||||
.then(async (res) => { })
|
.then(() => {
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
|
|
@ -293,3 +170,197 @@ const clickBack = () => {
|
||||||
router.push({ name: "insigniaProposals" });
|
router.push({ name: "insigniaProposals" });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||||
|
<div class="toptitle col-12 row items-center">
|
||||||
|
<q-btn
|
||||||
|
icon="mdi-arrow-left"
|
||||||
|
unelevated
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
color="primary"
|
||||||
|
class="q-mr-sm"
|
||||||
|
@click="clickBack"
|
||||||
|
/>
|
||||||
|
{{
|
||||||
|
edit
|
||||||
|
? "รอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
|
||||||
|
: "เพิ่มรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
<q-form ref="myForm">
|
||||||
|
<div class="col-12">
|
||||||
|
<q-card bordered>
|
||||||
|
<div class="col-12 row q-col-gutter-md q-pa-md">
|
||||||
|
<div class="col-xs-12 col-sm-12 row">
|
||||||
|
<q-separator />
|
||||||
|
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||||
|
<q-select
|
||||||
|
class="col-10"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model="roundInsig"
|
||||||
|
:options="options"
|
||||||
|
option-value="value"
|
||||||
|
option-label="label"
|
||||||
|
label="รอบการเสนอขอพระราชทานเครื่องราชฯ"
|
||||||
|
@update:model-value="updateDateRange"
|
||||||
|
:rules="[(val) => !!val || `${'กรุณาเลือกรอบที่'}`]"
|
||||||
|
/>
|
||||||
|
<datepicker
|
||||||
|
menu-class-name="modalfix"
|
||||||
|
v-model="yearly"
|
||||||
|
class="col-2"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
year-picker
|
||||||
|
:enableTimePicker="false"
|
||||||
|
@update:modelValue="updateYear"
|
||||||
|
>
|
||||||
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
|
<template #year-overlay-value="{ value }">{{
|
||||||
|
parseInt(value + 543)
|
||||||
|
}}</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
outlined
|
||||||
|
:model-value="yearly + 543"
|
||||||
|
:rules="[(val) => !!val || `${'กรุณาเลือกปีที่เสนอ'}`]"
|
||||||
|
:label="`${'ปีที่เสนอ'}`"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
style="color: var(--q-primary)"
|
||||||
|
>
|
||||||
|
</q-icon>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
<datepicker
|
||||||
|
menu-class-name="modalfix"
|
||||||
|
v-model="dateStart"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
class="col-xs-12 col-sm-5"
|
||||||
|
borderless
|
||||||
|
:enableTimePicker="false"
|
||||||
|
week-start="0"
|
||||||
|
>
|
||||||
|
<template #year="{ year }">
|
||||||
|
{{ year + 543 }}
|
||||||
|
</template>
|
||||||
|
<template #year-overlay-value="{ value }">
|
||||||
|
{{ parseInt(value + 543) }}
|
||||||
|
</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
class="full-width datepicker"
|
||||||
|
:model-value="
|
||||||
|
dateStart != null ? date2Thai(dateStart) : null
|
||||||
|
"
|
||||||
|
:label="`${'วันเริ่มต้น'}`"
|
||||||
|
:rules="[(val) => !!val || `${'กรุณาเลือกวันเริ่มต้น'}`]"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
style="color: var(--q-primary)"
|
||||||
|
>
|
||||||
|
</q-icon>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
<datepicker
|
||||||
|
menu-class-name="modalfix"
|
||||||
|
v-model="dateEnd"
|
||||||
|
class="col-xs-12 col-sm-5"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
borderless
|
||||||
|
:enableTimePicker="false"
|
||||||
|
week-start="0"
|
||||||
|
>
|
||||||
|
<template #year="{ year }">
|
||||||
|
{{ year + 543 }}
|
||||||
|
</template>
|
||||||
|
<template #year-overlay-value="{ value }">
|
||||||
|
{{ parseInt(value + 543) }}
|
||||||
|
</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
class="col-xs-12 col-sm-4"
|
||||||
|
:model-value="dateEnd != null ? date2Thai(dateEnd) : null"
|
||||||
|
:label="`${'วันสิ้นสุด'}`"
|
||||||
|
:rules="[
|
||||||
|
(val) => !!val || `${'กรุณาเลือกวันที่วันสิ้นสุด'}`,
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
style="color: var(--q-primary)"
|
||||||
|
>
|
||||||
|
</q-icon>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
|
||||||
|
<q-input
|
||||||
|
class="col-xs-12 col-sm-2"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model="datelast"
|
||||||
|
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
|
||||||
|
/>
|
||||||
|
<q-file
|
||||||
|
class="col-xs-12 col-sm-10"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
v-model="files"
|
||||||
|
@added="fileUploadDoc"
|
||||||
|
label="อัปโหลดเอกสารประกอบ"
|
||||||
|
hide-bottom-space
|
||||||
|
lazy-rules
|
||||||
|
>
|
||||||
|
<!-- :rules="[
|
||||||
|
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
|
||||||
|
]" -->
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon name="attach_file" />
|
||||||
|
</template>
|
||||||
|
</q-file>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<q-separator />
|
||||||
|
<q-separator />
|
||||||
|
<div class="row col-12 q-pa-sm">
|
||||||
|
<q-space />
|
||||||
|
<q-btn
|
||||||
|
unelevated
|
||||||
|
dense
|
||||||
|
class="q-px-md items-center"
|
||||||
|
color="light-blue-10"
|
||||||
|
label="บันทึก"
|
||||||
|
@click="checkSave"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</q-card>
|
||||||
|
</div>
|
||||||
|
</q-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,7 @@ import router from "@/router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import type { FormProprsalsRound } from " @/modules/07_insignia/interface/request/Main.ts";
|
import type { FormProprsalsRound } from " @/modules/07_insignia/interface/request/Main.ts";
|
||||||
import { useRoute } from "vue-router";
|
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
@ -15,22 +13,12 @@ const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
success,
|
success,
|
||||||
messageError,
|
messageError,
|
||||||
statusLeave,
|
|
||||||
dialogMessage,
|
|
||||||
dateToISO,
|
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
|
dialogRemove,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const route = useRoute();
|
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
const modal = ref<boolean>(false);
|
|
||||||
const pagination = ref({
|
|
||||||
sortBy: "desc",
|
|
||||||
descending: false,
|
|
||||||
page: 1,
|
|
||||||
rowsPerPage: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"round",
|
"round",
|
||||||
|
|
@ -194,34 +182,22 @@ const clickEdit = (col: any) => {
|
||||||
router.push(`/insignia/round-add/${col.id}`);
|
router.push(`/insignia/round-add/${col.id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// หัวตาราง2
|
|
||||||
const clickDelete = (id: string) => {
|
const clickDelete = (id: string) => {
|
||||||
$q.dialog({
|
dialogRemove($q, async () => {
|
||||||
title: "ยืนยันการลบข้อมูล",
|
showLoader();
|
||||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
await http
|
||||||
cancel: {
|
.delete(config.API.RoundInsignia(id))
|
||||||
flat: true,
|
.then(() => {
|
||||||
color: "negative",
|
success($q, "ลบข้อมูลการเสนอขอสำเร็จ");
|
||||||
},
|
fetchData();
|
||||||
persistent: true,
|
})
|
||||||
})
|
.catch((e) => {
|
||||||
.onOk(async () => {
|
messageError($q, e);
|
||||||
showLoader();
|
})
|
||||||
await http
|
.finally(() => {
|
||||||
.delete(config.API.RoundInsignia(id))
|
hideLoader();
|
||||||
.then((res) => {
|
});
|
||||||
success($q, "ลบข้อมูลการเสนอขอสำเร็จ");
|
});
|
||||||
fetchData();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.onCancel(() => {})
|
|
||||||
.onDismiss(() => {});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickAdd = () => {
|
const clickAdd = () => {
|
||||||
|
|
@ -247,12 +223,10 @@ const getRequest = async (id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.requestInsignia(id))
|
.get(config.API.requestInsignia(id))
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
console.log(res);
|
|
||||||
success($q, "ยืนยันสำเร็จ");
|
success($q, "ยืนยันสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
|
|
@ -268,16 +242,14 @@ const resetFilter = () => {
|
||||||
filterRef.value.focus();
|
filterRef.value.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
const filterKeyword2 = ref<string>("");
|
|
||||||
const filterRef2 = ref<any>(null);
|
|
||||||
const resetFilter2 = () => {
|
|
||||||
filterKeyword2.value = "";
|
|
||||||
filterRef2.value.focus();
|
|
||||||
};
|
|
||||||
|
|
||||||
const attrs = ref<any>(useAttrs());
|
const attrs = ref<any>(useAttrs());
|
||||||
|
|
||||||
const paging = ref<boolean>(true);
|
const paging = ref<boolean>(true);
|
||||||
|
const pagination = ref({
|
||||||
|
sortBy: "desc",
|
||||||
|
descending: false,
|
||||||
|
page: 1,
|
||||||
|
rowsPerPage: 10,
|
||||||
|
});
|
||||||
const paginationLabel = (start: string, end: string, total: string) => {
|
const paginationLabel = (start: string, end: string, total: string) => {
|
||||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||||
else return start + "-" + end + " ใน " + total;
|
else return start + "-" + end + " ใน " + total;
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,7 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const { dialogConfirm, showLoader, hideLoader, messageError, success } = mixin;
|
||||||
dialogRemove,
|
|
||||||
dialogConfirm,
|
|
||||||
showLoader,
|
|
||||||
hideLoader,
|
|
||||||
messageError,
|
|
||||||
success,
|
|
||||||
} = mixin;
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
|
|
||||||
|
|
@ -30,7 +23,6 @@ const modalAdd = ref<boolean>(false);
|
||||||
const modalEdit = ref<boolean>(false);
|
const modalEdit = ref<boolean>(false);
|
||||||
const rowid = ref<string>("");
|
const rowid = ref<string>("");
|
||||||
const organization = ref<string>("");
|
const organization = ref<string>("");
|
||||||
const fileId = ref<string>("");
|
|
||||||
|
|
||||||
const organizationOptions = ref<any>([{ id: "1", name: "ทั้งหมด" }]);
|
const organizationOptions = ref<any>([{ id: "1", name: "ทั้งหมด" }]);
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
|
|
@ -178,7 +170,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const rows2 = ref<any[]>([]);
|
const rows2 = ref<any[]>([]);
|
||||||
|
|
||||||
const person = ref<any>([]);
|
const person = ref<any>([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
tab: {
|
tab: {
|
||||||
|
|
@ -205,10 +196,6 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// if (DataStore.typeOc == "") {
|
|
||||||
// // organization.value = DataStore.optionsTypeOc[2].id;
|
|
||||||
// DataStore.typeOc = organization.value;
|
|
||||||
// } else organization.value = DataStore.typeOc;
|
|
||||||
organization.value = await (DataStore.agency != null
|
organization.value = await (DataStore.agency != null
|
||||||
? DataStore.agency
|
? DataStore.agency
|
||||||
: DataStore.typeOc);
|
: DataStore.typeOc);
|
||||||
|
|
@ -250,7 +237,6 @@ const fecthlistRetire = async () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
// console.log(e);
|
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -271,8 +257,6 @@ const fecthlistperson = async (id: string) => {
|
||||||
criterias: data,
|
criterias: data,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log(res);
|
|
||||||
|
|
||||||
rows2.value = res.data.result.map((e: any) => ({
|
rows2.value = res.data.result.map((e: any) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
fullname: e.fullname == null ? "-" : e.fullname,
|
fullname: e.fullname == null ? "-" : e.fullname,
|
||||||
|
|
@ -283,14 +267,12 @@ const fecthlistperson = async (id: string) => {
|
||||||
modalAdd.value = true;
|
modalAdd.value = true;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
// console.log(e);
|
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickAdd = async (id: string) => {
|
const clickAdd = async (id: string) => {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -306,17 +288,14 @@ const addlistperson = async (id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
let data = {
|
let data = {
|
||||||
profileId: id,
|
profileId: id,
|
||||||
// insigniaId: organization.value,
|
|
||||||
insigniaPeriodId: props.roundId,
|
insigniaPeriodId: props.roundId,
|
||||||
};
|
};
|
||||||
// console.log(data);
|
|
||||||
await http
|
await http
|
||||||
.post(config.API.insigniaCreate(), data)
|
.post(config.API.insigniaCreate(), data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, "เพิ่มรายชื่อสำเร็จ");
|
success($q, "เพิ่มรายชื่อสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
// console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -333,20 +312,11 @@ const addlistperson = async (id: string) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// const clickAction = (props: any, action: string) => {
|
|
||||||
// Note.value = "";
|
|
||||||
// person.value = props;
|
|
||||||
// titleModal.value = props.name;
|
|
||||||
// actionModal.value = action;
|
|
||||||
// modalNote.value = true;
|
|
||||||
// };
|
|
||||||
const clickmodalEdit = (props: any) => {
|
const clickmodalEdit = (props: any) => {
|
||||||
insignia.value = props.insigniaSend;
|
insignia.value = props.insigniaSend;
|
||||||
// insigniaType.value = props.insigniaLevel;
|
|
||||||
person.value = props;
|
person.value = props;
|
||||||
modalEdit.value = true;
|
modalEdit.value = true;
|
||||||
fecthInsignia();
|
fecthInsignia();
|
||||||
// fecthInsigniaType();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const downloadFile = (response: any, filename: string) => {
|
const downloadFile = (response: any, filename: string) => {
|
||||||
|
|
@ -393,7 +363,6 @@ const clickSave = () => {
|
||||||
const listEdit = async (profileId: string) => {
|
const listEdit = async (profileId: string) => {
|
||||||
let data: any = {
|
let data: any = {
|
||||||
insigniaId: insignia.value,
|
insigniaId: insignia.value,
|
||||||
// insigniaTypeId: insigniaType.value,
|
|
||||||
};
|
};
|
||||||
await http
|
await http
|
||||||
.put(config.API.insigniaEdit(profileId), data)
|
.put(config.API.insigniaEdit(profileId), data)
|
||||||
|
|
@ -499,7 +468,6 @@ const listdelete = async (id: string, reason: string) => {
|
||||||
const insignia = ref<string>("");
|
const insignia = ref<string>("");
|
||||||
const insigniaOptions = ref<any>([]);
|
const insigniaOptions = ref<any>([]);
|
||||||
const insigniaType = ref<string>("");
|
const insigniaType = ref<string>("");
|
||||||
// const insigniaTypeOptions = ref<any>([]);
|
|
||||||
|
|
||||||
const fecthInsignia = async () => {
|
const fecthInsignia = async () => {
|
||||||
await http
|
await http
|
||||||
|
|
@ -507,17 +475,10 @@ const fecthInsignia = async () => {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
insigniaOptions.value = res.data.result;
|
insigniaOptions.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((e) => {
|
||||||
// console.log(err);
|
messageError($q, e);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// const fecthInsigniaType = async () => {
|
|
||||||
// await http(config.API.insigniaType)
|
|
||||||
// .then((res) => {
|
|
||||||
// insigniaTypeOptions.value = res.data.result;
|
|
||||||
// })
|
|
||||||
// .catch((err) => {});
|
|
||||||
// };
|
|
||||||
|
|
||||||
const nextPage = (id: string) => {
|
const nextPage = (id: string) => {
|
||||||
router.push(`/registry/${id}`);
|
router.push(`/registry/${id}`);
|
||||||
|
|
@ -559,7 +520,6 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
||||||
<div class="col-12 row q-pa-md">
|
<div class="col-12 row q-pa-md">
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="row col-12 q-col-gutter-sm">
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
<!-- {{ DataStore.typeinsigniaOptions }} -->
|
|
||||||
<q-select
|
<q-select
|
||||||
v-if="props.roleUser == 'admin'"
|
v-if="props.roleUser == 'admin'"
|
||||||
v-model="organization"
|
v-model="organization"
|
||||||
|
|
@ -958,31 +918,14 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
||||||
style="min-width: 150px"
|
style="min-width: 150px"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col">
|
|
||||||
<q-select
|
|
||||||
v-model="insigniaType"
|
|
||||||
label="ชั้นเครื่องราชฯ"
|
|
||||||
dense
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
:options="insigniaTypeOptions"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
lazy-rules
|
|
||||||
hide-bottom-space
|
|
||||||
:readonly="false"
|
|
||||||
:borderless="false"
|
|
||||||
:outlined="true"
|
|
||||||
:hide-dropdown-icon="false"
|
|
||||||
style="min-width: 150px"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<div class="row justify-end">
|
<div class="row justify-end">
|
||||||
<q-btn label="บันทึก" @click="clickSave" color="public" />
|
<q-btn label="บันทึก" @click="clickSave" color="public"
|
||||||
|
><q-tooltip>บันทึก</q-tooltip></q-btn
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
@ -1002,54 +945,4 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
||||||
:click-close="closemodelPopupDelete"
|
:click-close="closemodelPopupDelete"
|
||||||
:savaForm="savaReasonDelete"
|
:savaForm="savaReasonDelete"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- note -->
|
|
||||||
<!-- <q-dialog v-model="modalNote" persistent>
|
|
||||||
<q-card style="min-width: 350px">
|
|
||||||
<q-toolbar>
|
|
||||||
<q-toolbar-title class="text-subtitle2 text-bold">
|
|
||||||
<div v-if="actionModal == 'note'">
|
|
||||||
เป็นเหตุผลที่ไม่ยื่นขอ {{ titleModal }}
|
|
||||||
</div>
|
|
||||||
<div v-if="actionModal == 'delete'">ลบออก {{ titleModal }}</div>
|
|
||||||
</q-toolbar-title>
|
|
||||||
<q-btn
|
|
||||||
icon="close"
|
|
||||||
unelevated
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
@click="modalNote = false"
|
|
||||||
style="color: #ff8080; background-color: #ffdede"
|
|
||||||
/> </q-toolbar
|
|
||||||
><q-separator />
|
|
||||||
<q-card-section class="q-pt-none"></q-card-section>
|
|
||||||
<q-card-section class="q-pt-none">
|
|
||||||
<q-input
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
type="textarea"
|
|
||||||
label="เหตุผลที่ไม่ยื่นขอ"
|
|
||||||
v-model="Note"
|
|
||||||
@keyup.enter="modalNote = false"
|
|
||||||
:rules="[(val) => !!val || 'เหตุผลที่ไม่ยื่นขอ']"
|
|
||||||
/>
|
|
||||||
</q-card-section>
|
|
||||||
<q-card-actions align="right" class="bg-white text-teal">
|
|
||||||
<q-btn
|
|
||||||
v-if="actionModal == 'note'"
|
|
||||||
label="บันทึก"
|
|
||||||
@click="clickSavenote"
|
|
||||||
color="public"
|
|
||||||
:disable="Note === ''"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
v-if="actionModal == 'delete'"
|
|
||||||
label="บันทึก"
|
|
||||||
@click="clickDelete"
|
|
||||||
color="public"
|
|
||||||
:disable="Note === ''"
|
|
||||||
/>
|
|
||||||
</q-card-actions>
|
|
||||||
</q-card>
|
|
||||||
</q-dialog> -->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,7 @@ import { useRouter } from "vue-router";
|
||||||
import DialogInformation from "@/components/Dialogs/Information.vue";
|
import DialogInformation from "@/components/Dialogs/Information.vue";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
import http from "@/plugins/http";
|
|
||||||
import config from "@/app.config";
|
|
||||||
|
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
tab: {
|
tab: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -38,7 +34,6 @@ const visibleColumns = ref<string[]>([
|
||||||
"position",
|
"position",
|
||||||
"level",
|
"level",
|
||||||
"salary",
|
"salary",
|
||||||
|
|
||||||
"insigniaType",
|
"insigniaType",
|
||||||
"insigniaSend",
|
"insigniaSend",
|
||||||
"insigniaLevel",
|
"insigniaLevel",
|
||||||
|
|
@ -143,12 +138,9 @@ onMounted(async () => {
|
||||||
organization.value = await (DataStore.agency != null
|
organization.value = await (DataStore.agency != null
|
||||||
? DataStore.agency
|
? DataStore.agency
|
||||||
: DataStore.typeOc);
|
: DataStore.typeOc);
|
||||||
// if (props.fecthInsigniaAll) {
|
|
||||||
// await props.fecthInsigniaAll(props.roundId, props.tab);
|
|
||||||
// }
|
|
||||||
if (organization.value !== "" || organization.value !== undefined) {
|
if (organization.value !== "" || organization.value !== undefined) {
|
||||||
if (props.fecthInsigniaByOc) {
|
if (props.fecthInsigniaByOc) {
|
||||||
props.fecthInsigniaByOc(
|
await props.fecthInsigniaByOc(
|
||||||
props.roundId,
|
props.roundId,
|
||||||
organization.value,
|
organization.value,
|
||||||
"officer",
|
"officer",
|
||||||
|
|
@ -207,7 +199,6 @@ const closeReson = () => {
|
||||||
<template>
|
<template>
|
||||||
<div class="col-12 row q-pa-md">
|
<div class="col-12 row q-pa-md">
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<!-- {{ DataStore.typeinsigniaOptions }} -->
|
|
||||||
<div class="row col-12 q-col-gutter-sm">
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
<q-select
|
<q-select
|
||||||
v-if="props.roleUser == 'admin'"
|
v-if="props.roleUser == 'admin'"
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import DialogInformation from "@/components/Dialogs/Information.vue";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
tab: {
|
tab: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -138,12 +137,10 @@ onMounted(async () => {
|
||||||
organization.value = await (DataStore.agency != null
|
organization.value = await (DataStore.agency != null
|
||||||
? DataStore.agency
|
? DataStore.agency
|
||||||
: DataStore.typeOc);
|
: DataStore.typeOc);
|
||||||
// if (props.fecthInsigniaAll) {
|
|
||||||
// await props.fecthInsigniaAll(props.roundId, props.tab);
|
|
||||||
// }
|
|
||||||
if (organization.value !== "" || organization.value !== undefined) {
|
if (organization.value !== "" || organization.value !== undefined) {
|
||||||
if (props.fecthInsigniaByOc) {
|
if (props.fecthInsigniaByOc) {
|
||||||
props.fecthInsigniaByOc(
|
await props.fecthInsigniaByOc(
|
||||||
props.roundId,
|
props.roundId,
|
||||||
organization.value,
|
organization.value,
|
||||||
"officer",
|
"officer",
|
||||||
|
|
@ -152,9 +149,9 @@ onMounted(async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const changtypeOc = () => {
|
const changtypeOc = async () => {
|
||||||
if (props.fecthInsigniaByOc) {
|
if (props.fecthInsigniaByOc) {
|
||||||
props.fecthInsigniaByOc(
|
await props.fecthInsigniaByOc(
|
||||||
props.roundId,
|
props.roundId,
|
||||||
organization.value,
|
organization.value,
|
||||||
"officer",
|
"officer",
|
||||||
|
|
@ -342,8 +339,7 @@ const closeReson = () => {
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="blue"
|
color="blue"
|
||||||
@click.stop
|
@click.stop="showNote(props.row)"
|
||||||
@click="showNote(props.row)"
|
|
||||||
icon="mdi-information-outline"
|
icon="mdi-information-outline"
|
||||||
>
|
>
|
||||||
<q-tooltip>เหตุผลการลบ</q-tooltip>
|
<q-tooltip>เหตุผลการลบ</q-tooltip>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import config from "@/app.config";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError } = mixin;
|
const { showLoader, hideLoader, messageError } = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
roundId: {
|
roundId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -73,12 +72,6 @@ const fecthOrg = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const filterKeyword = ref<string>("");
|
|
||||||
const filterRef = ref<any>(null);
|
|
||||||
const resetFilter = () => {
|
|
||||||
filterKeyword.value = "";
|
|
||||||
filterRef.value.focus();
|
|
||||||
};
|
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
sortBy: "desc",
|
sortBy: "desc",
|
||||||
descending: false,
|
descending: false,
|
||||||
|
|
@ -94,77 +87,11 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<template>
|
<template>
|
||||||
<div class="col-12 row q-pa-md">
|
<div class="col-12 row q-pa-md">
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<!-- <div class="row col-12 q-col-gutter-sm">
|
|
||||||
<q-select
|
|
||||||
v-model="organization"
|
|
||||||
label="หน่วยงาน"
|
|
||||||
dense
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
:options="organizationOptions"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
lazy-rules
|
|
||||||
hide-bottom-space
|
|
||||||
:readonly="false"
|
|
||||||
:borderless="false"
|
|
||||||
:outlined="true"
|
|
||||||
:hide-dropdown-icon="false"
|
|
||||||
style="min-width: 150px"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<q-btn size="md" icon="mdi-download" flat round color="primary">
|
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
|
||||||
</q-btn>
|
|
||||||
<q-btn size="12px" flat round color="add" icon="mdi-plus">
|
|
||||||
<q-tooltip>เพิ่ม</q-tooltip>
|
|
||||||
</q-btn>
|
|
||||||
</div>
|
|
||||||
<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="ค้นหา"
|
|
||||||
>
|
|
||||||
<template v-slot:append>
|
|
||||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
|
||||||
<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"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-table
|
<q-table
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:filter="filterKeyword"
|
|
||||||
row-key="name"
|
row-key="name"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
|
|
@ -180,8 +107,6 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
<!-- <q-th auto-width />
|
|
||||||
<q-th auto-width /> -->
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref, watch } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -21,17 +21,13 @@ const roleUser = ref<string>("admin");
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
||||||
const router = useRouter();
|
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
|
|
||||||
const loading = ref<boolean>(false);
|
const loading = ref<boolean>(false);
|
||||||
const round = ref<string>("");
|
const round = ref<string>("");
|
||||||
const roundName = ref<string>("");
|
const roundName = ref<string>("");
|
||||||
|
|
||||||
const optionRound = ref<any>([]);
|
const optionRound = ref<any>([]);
|
||||||
// const typeOc = ref<string>("kljkljk");
|
|
||||||
const optiontypeOc = ref<any>([]);
|
const optiontypeOc = ref<any>([]);
|
||||||
|
|
||||||
const tab = ref<any>("pending");
|
const tab = ref<any>("pending");
|
||||||
const stat = ref<any>({
|
const stat = ref<any>({
|
||||||
allUserUser: 0,
|
allUserUser: 0,
|
||||||
|
|
@ -57,7 +53,6 @@ const checkRole = async () => {
|
||||||
} else {
|
} else {
|
||||||
roleUser.value = "admin";
|
roleUser.value = "admin";
|
||||||
}
|
}
|
||||||
// console.log("roleUser ===> ", roleUser.value);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -70,8 +65,6 @@ const fecthlistRound = async () => {
|
||||||
year: e.period_year,
|
year: e.period_year,
|
||||||
name: e.period_name,
|
name: e.period_name,
|
||||||
}));
|
}));
|
||||||
// console.log(optionRound.value);
|
|
||||||
// const lastIndex = optionRound.value.length;
|
|
||||||
const lastValue = optionRound.value[0];
|
const lastValue = optionRound.value[0];
|
||||||
round.value = lastValue.id.toString();
|
round.value = lastValue.id.toString();
|
||||||
roundName.value = lastValue.name;
|
roundName.value = lastValue.name;
|
||||||
|
|
@ -126,10 +119,8 @@ const fecthType = async () => {
|
||||||
name: e.organizationName,
|
name: e.organizationName,
|
||||||
}));
|
}));
|
||||||
DataStore.fetchOption(optiontypeOc.value);
|
DataStore.fetchOption(optiontypeOc.value);
|
||||||
// DataStore.optionsTypeOc = ;
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -151,21 +142,6 @@ const changround = async () => {
|
||||||
roundFilter.year + 543
|
roundFilter.year + 543
|
||||||
}`;
|
}`;
|
||||||
};
|
};
|
||||||
// const fecthInsigniaAll = async (periodId: string, tab: string) => {
|
|
||||||
// // let data: any = [];
|
|
||||||
// // for (const item of DataStore.optionsTypeOc) {
|
|
||||||
// // await http
|
|
||||||
// // .get(config.API.insigniaList(periodId, item["id"], "officer", tab))
|
|
||||||
// // .then((res) => {
|
|
||||||
// // // console.log(res);
|
|
||||||
// // data.push(res.data.result);
|
|
||||||
// // })
|
|
||||||
// // .catch((err) => {
|
|
||||||
// // console.log(err);
|
|
||||||
// // });
|
|
||||||
// // }
|
|
||||||
// // console.log(data);
|
|
||||||
// };
|
|
||||||
const requestNote = ref<string>("");
|
const requestNote = ref<string>("");
|
||||||
const requestStatus = ref<string>("");
|
const requestStatus = ref<string>("");
|
||||||
const fecthInsigniaByOc = async (
|
const fecthInsigniaByOc = async (
|
||||||
|
|
@ -175,19 +151,16 @@ const fecthInsigniaByOc = async (
|
||||||
status: string
|
status: string
|
||||||
) => {
|
) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
// console.log("ocId===>", ocId);
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.insigniaList(roundId, ocId, role, status))
|
.get(config.API.insigniaList(roundId, ocId, role, status))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
// console.log(res);
|
|
||||||
requestNote.value = res.data.result.requestNote;
|
requestNote.value = res.data.result.requestNote;
|
||||||
requestStatus.value = res.data.result.requestStatus;
|
requestStatus.value = res.data.result.requestStatus;
|
||||||
|
|
||||||
await DataStore.fetchData(res.data.result.items);
|
await DataStore.fetchData(res.data.result.items);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
// console.log(err);
|
messageError($q, err);
|
||||||
messageError($q);
|
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
@ -210,7 +183,6 @@ const sendToDirector = async () => {
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
// console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -249,7 +221,6 @@ const backToEdit = async (reason: string) => {
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
// console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -279,7 +250,6 @@ const directorApproved = async () => {
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
// console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -308,7 +278,6 @@ const requestSendNote = async () => {
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
// console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -479,7 +448,9 @@ const requestSendNote = async () => {
|
||||||
color="public"
|
color="public"
|
||||||
class="q-px-md q-ml-md"
|
class="q-px-md q-ml-md"
|
||||||
@click="requestSendNote"
|
@click="requestSendNote"
|
||||||
/>
|
>
|
||||||
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
|
|
||||||
<DialogPopupReason
|
<DialogPopupReason
|
||||||
|
|
|
||||||
|
|
@ -20,22 +20,18 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
notifyError,
|
notifyError,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const status = ref<status>("");
|
const status = ref<string>("");
|
||||||
|
|
||||||
const Advertise = ref<string>("");
|
const Advertise = ref<string>("");
|
||||||
const issue = ref<string>("");
|
const issue = ref<string>("");
|
||||||
const brand = ref<string>("");
|
const brand = ref<string>("");
|
||||||
const cardid = ref<string>("");
|
const cardid = ref<string>("");
|
||||||
const prefixId = ref<string>("");
|
|
||||||
const fullName = ref<string>("");
|
const fullName = ref<string>("");
|
||||||
const volume = ref<string>("");
|
const volume = ref<string>("");
|
||||||
const episode = ref<string>("");
|
const episode = ref<string>("");
|
||||||
const duty = ref<string>("");
|
const duty = ref<string>("");
|
||||||
const announced = ref<string>("");
|
const announced = ref<string>("");
|
||||||
const firstname = ref<string>("");
|
|
||||||
const lastname = ref<string>("");
|
|
||||||
const position = ref<string>("");
|
const position = ref<string>("");
|
||||||
const invoice = ref<string | null>(null);
|
|
||||||
const payment = ref<string>("");
|
const payment = ref<string>("");
|
||||||
const addressPayment = ref<string | null>(null);
|
const addressPayment = ref<string | null>(null);
|
||||||
const affiliationRequest = ref<string>("");
|
const affiliationRequest = ref<string>("");
|
||||||
|
|
@ -56,46 +52,6 @@ const paymentOp = [
|
||||||
{ label: "จัดส่งทางไปรษณี", value: "จัดส่งทางไปรษณี" },
|
{ label: "จัดส่งทางไปรษณี", value: "จัดส่งทางไปรษณี" },
|
||||||
{ label: "มารับด้วยตัวเอง", value: "มารับด้วยตัวเอง" },
|
{ label: "มารับด้วยตัวเอง", value: "มารับด้วยตัวเอง" },
|
||||||
];
|
];
|
||||||
const volumeOp = [
|
|
||||||
{ label: "เล่มที่", value: "xx1" },
|
|
||||||
{ label: "เล่มที่2", value: "xx2" },
|
|
||||||
{ label: "เล่มที่3", value: "xx3" },
|
|
||||||
];
|
|
||||||
const episodeOp = [
|
|
||||||
{ label: "ตอนที่1", value: "xx1" },
|
|
||||||
{ label: "ตอนที่2", value: "xx2" },
|
|
||||||
{ label: "ตอนที่3", value: "xx3" },
|
|
||||||
];
|
|
||||||
const dutyOp = [
|
|
||||||
{ label: "หน้าที่1", value: "xx1" },
|
|
||||||
{ label: "หน้าที่2", value: "xx2" },
|
|
||||||
{ label: "หน้าที่3", value: "xx3" },
|
|
||||||
];
|
|
||||||
const announcedOp = [
|
|
||||||
{ label: "ลำดับที่1", value: "xx1" },
|
|
||||||
{ label: "ลำดับที่2", value: "xx2" },
|
|
||||||
{ label: "ลำดับที่3", value: "xx3" },
|
|
||||||
];
|
|
||||||
const affiliationRequestOp = [
|
|
||||||
{ label: "สังกัด1", value: "xx1" },
|
|
||||||
{ label: "สังกัด2", value: "xx2" },
|
|
||||||
{ label: "สังกัด3", value: "xx3" },
|
|
||||||
];
|
|
||||||
const affiliationReceivedOp = [
|
|
||||||
{ label: "สังกัด4", value: "xx4" },
|
|
||||||
{ label: "สังกัด5", value: "xx5" },
|
|
||||||
{ label: "สังกัด6", value: "xx6" },
|
|
||||||
];
|
|
||||||
const prefixOp = [
|
|
||||||
{ label: "นาย", value: "mr" },
|
|
||||||
{ label: "นางสาว", value: "miss" },
|
|
||||||
{ label: "นาง", value: "mrs" },
|
|
||||||
];
|
|
||||||
const positionOp = [
|
|
||||||
{ label: "ตำแหน่ง1", value: "xxx1" },
|
|
||||||
{ label: "ตำแหน่ง2", value: "xxx2" },
|
|
||||||
{ label: "ตำแหน่ง3", value: "xxx3" },
|
|
||||||
];
|
|
||||||
const clearDateExam = () => {
|
const clearDateExam = () => {
|
||||||
receivedate.value = null;
|
receivedate.value = null;
|
||||||
announceDate.value = null;
|
announceDate.value = null;
|
||||||
|
|
@ -141,12 +97,12 @@ watch(props, () => {
|
||||||
episode.value = "";
|
episode.value = "";
|
||||||
duty.value = "";
|
duty.value = "";
|
||||||
announced.value = "";
|
announced.value = "";
|
||||||
// invoice.value = "";
|
|
||||||
invoiceDate.value = null;
|
invoiceDate.value = null;
|
||||||
payment.value = "";
|
payment.value = "";
|
||||||
|
if (props.personId !== undefined) {
|
||||||
if (props.action === "editData") {
|
if (props.action === "editData") {
|
||||||
fectDataByid(props.personId);
|
fectDataByid(props.personId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -205,11 +161,10 @@ const findlist = async (id: string) => {
|
||||||
criterias: data,
|
criterias: data,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log(res.data.result);
|
|
||||||
listPerson.value = res.data.result;
|
listPerson.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -217,7 +172,9 @@ const findlist = async (id: string) => {
|
||||||
};
|
};
|
||||||
const fectDataByid = async (id: string) => {
|
const fectDataByid = async (id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
employeeClass.value = "";
|
if (props.profileType !== undefined) {
|
||||||
|
employeeClass.value = props.profileType.toString();
|
||||||
|
}
|
||||||
await http
|
await http
|
||||||
.get(config.API.noteByid(id))
|
.get(config.API.noteByid(id))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
@ -240,7 +197,6 @@ const fectDataByid = async (id: string) => {
|
||||||
payment.value = data.typePayment;
|
payment.value = data.typePayment;
|
||||||
addressPayment.value = data.address;
|
addressPayment.value = data.address;
|
||||||
status.value = data.status;
|
status.value = data.status;
|
||||||
employeeClass.value = props.profileType;
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
@ -264,7 +220,6 @@ const clickSave = async () => {
|
||||||
section: episode.value, //ตอนที่
|
section: episode.value, //ตอนที่
|
||||||
page: duty.value, //หน้าที่
|
page: duty.value, //หน้าที่
|
||||||
no: announced.value,
|
no: announced.value,
|
||||||
// รอฟิล: invoice.value,
|
|
||||||
datePayment: invoiceDate.value, //วันที่จ่าย
|
datePayment: invoiceDate.value, //วันที่จ่าย
|
||||||
typePayment: payment.value, // รูปแบบการจ่าย
|
typePayment: payment.value, // รูปแบบการจ่าย
|
||||||
address: addressPayment.value, //ที่อยู่
|
address: addressPayment.value, //ที่อยู่
|
||||||
|
|
@ -278,20 +233,21 @@ const clickSave = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const addNote = async (body: any) => {
|
const addNote = async (body: any) => {
|
||||||
await http
|
if (props.roundId !== undefined) {
|
||||||
.put(config.API.noteAdd(props.roundId), body)
|
await http
|
||||||
.then(() => {
|
.put(config.API.noteAdd(props.roundId), body)
|
||||||
success($q, "เพิ่มราชชื่อสำเร็จ");
|
.then(() => {
|
||||||
})
|
success($q, "เพิ่มราชชื่อสำเร็จ");
|
||||||
.catch((err) => {
|
})
|
||||||
messageError($q, err);
|
.catch((err) => {
|
||||||
})
|
messageError($q, err);
|
||||||
.finally(() => {
|
})
|
||||||
props.close();
|
.finally(() => {
|
||||||
});
|
props.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const searchcardid = () => {
|
const searchcardid = () => {
|
||||||
// console.log(cardid.value);
|
|
||||||
if (cardid.value.length === 13) {
|
if (cardid.value.length === 13) {
|
||||||
let data = listPerson.value.find((e: any) => e.citizenId === cardid.value);
|
let data = listPerson.value.find((e: any) => e.citizenId === cardid.value);
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
@ -314,7 +270,8 @@ const searchcardid = () => {
|
||||||
dense
|
dense
|
||||||
@click="props.close"
|
@click="props.close"
|
||||||
style="color: #ff8080; background-color: #ffdede"
|
style="color: #ff8080; background-color: #ffdede"
|
||||||
/>
|
><q-tooltip>ปืด</q-tooltip></q-btn
|
||||||
|
>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
|
|
@ -368,24 +325,8 @@ const searchcardid = () => {
|
||||||
mask="#############"
|
mask="#############"
|
||||||
@keyup="searchcardid"
|
@keyup="searchcardid"
|
||||||
/>
|
/>
|
||||||
<!-- :rules="[(val:any) =>val.length != 13 ||`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,]" -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-xs-12 col-sm-4">
|
|
||||||
<q-select
|
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']"
|
|
||||||
hide-bottom-space
|
|
||||||
:options="prefixOp"
|
|
||||||
class="col-xs-12 col-sm-6 inputgreen"
|
|
||||||
dense
|
|
||||||
borderless
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
outlined
|
|
||||||
v-model="prefixId"
|
|
||||||
:label="`คำนำหน้าชื่อ`"
|
|
||||||
:disable="disbleStatus"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
<div class="col-xs-6 col-sm-4">
|
<div class="col-xs-6 col-sm-4">
|
||||||
<q-input
|
<q-input
|
||||||
disable
|
disable
|
||||||
|
|
@ -412,35 +353,10 @@ const searchcardid = () => {
|
||||||
v-model="position"
|
v-model="position"
|
||||||
:label="`ตำเเหน่ง`"
|
:label="`ตำเเหน่ง`"
|
||||||
/>
|
/>
|
||||||
<!-- <q-select
|
|
||||||
:disable="disbleStatus"
|
|
||||||
hide-bottom-space
|
|
||||||
:options="positionOp"
|
|
||||||
class="col-xs-12 col-sm-6 inputgreen"
|
|
||||||
dense
|
|
||||||
borderless
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
outlined
|
|
||||||
v-model="position"
|
|
||||||
:label="`ตำเเหน่ง`"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-6"></div>
|
<div class="col-6"></div>
|
||||||
|
|
||||||
<!-- <div class="col-xs-6 col-sm-3 col-md-5">
|
|
||||||
<q-input
|
|
||||||
hide-bottom-space
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
borderless
|
|
||||||
v-model="lastname"
|
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
|
||||||
:label="`${'นามสกุล'}`"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
||||||
<div class="col-12 text-weight-bold text-grey">
|
<div class="col-12 text-weight-bold text-grey">
|
||||||
รายละเอียดตำเเหน่ง
|
รายละเอียดตำเเหน่ง
|
||||||
|
|
@ -462,18 +378,6 @@ const searchcardid = () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<!-- <q-input
|
|
||||||
:disable="disbleStatus"
|
|
||||||
:rules="[
|
|
||||||
(val) => !!val || 'กรุณากรอกชื่อชั้นตราเครื่องราชอิสริยาภรณ์',
|
|
||||||
]"
|
|
||||||
hide-bottom-space
|
|
||||||
dense
|
|
||||||
borderless
|
|
||||||
outlined
|
|
||||||
v-model="brand"
|
|
||||||
label="ชั้นตราเครื่องราชอิสริยาภรณ์"
|
|
||||||
/> -->
|
|
||||||
<q-select
|
<q-select
|
||||||
:disable="disbleStatus || status == 'DONE'"
|
:disable="disbleStatus || status == 'DONE'"
|
||||||
v-model="brand"
|
v-model="brand"
|
||||||
|
|
@ -563,20 +467,6 @@ const searchcardid = () => {
|
||||||
v-model="affiliationRequest"
|
v-model="affiliationRequest"
|
||||||
label="สังกัด ณ วันที่ขอพระราชทานเครื่องราชอิสริยาภรณ์"
|
label="สังกัด ณ วันที่ขอพระราชทานเครื่องราชอิสริยาภรณ์"
|
||||||
/>
|
/>
|
||||||
<!-- <q-select
|
|
||||||
:disable="disbleStatus"
|
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกสังกัด']"
|
|
||||||
hide-bottom-space
|
|
||||||
:options="affiliationRequestOp"
|
|
||||||
class="col-xs-12 col-sm-6"
|
|
||||||
dense
|
|
||||||
borderless
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
outlined
|
|
||||||
v-model="affiliationRequest"
|
|
||||||
:label="`สังกัด ณ วันที่ขอพระราชทานเครื่องราชอิสริยาภรณ์`"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -591,19 +481,6 @@ const searchcardid = () => {
|
||||||
v-model="affiliationReceived"
|
v-model="affiliationReceived"
|
||||||
label="สังกัด ณ วันที่ได้รับประกาศนียบัตรกำกับเครื่องราชอิสริยาภรณ์"
|
label="สังกัด ณ วันที่ได้รับประกาศนียบัตรกำกับเครื่องราชอิสริยาภรณ์"
|
||||||
/>
|
/>
|
||||||
<!-- <q-select
|
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกสังกัด']"
|
|
||||||
hide-bottom-space
|
|
||||||
:options="affiliationReceivedOp"
|
|
||||||
class="col-xs-12 col-sm-6"
|
|
||||||
dense
|
|
||||||
borderless
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
outlined
|
|
||||||
v-model="affiliationReceived"
|
|
||||||
:label="`สังกัด ณ วันที่ได้รับประกาศนียบัตรกำกับเครื่องราชอิสริยาภรณ์`"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
||||||
<div class="col-12 text-weight-bold text-grey">
|
<div class="col-12 text-weight-bold text-grey">
|
||||||
|
|
@ -665,21 +542,6 @@ const searchcardid = () => {
|
||||||
:label="`เล่มที่`"
|
:label="`เล่มที่`"
|
||||||
:rules="[(val) => !!val || 'กรุณากรอกเล่มที่']"
|
:rules="[(val) => !!val || 'กรุณากรอกเล่มที่']"
|
||||||
/>
|
/>
|
||||||
<!-- <q-select
|
|
||||||
:disable="disbleStatus"
|
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกเล่มที่']"
|
|
||||||
hide-bottom-space
|
|
||||||
:options="volumeOp"
|
|
||||||
class="col-xs-12 col-sm-6"
|
|
||||||
dense
|
|
||||||
borderless
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
outlined
|
|
||||||
emit-value
|
|
||||||
v-model="volume"
|
|
||||||
:label="`เล่มที่`"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-4">
|
<div class="col-xs-12 col-sm-4">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -694,21 +556,6 @@ const searchcardid = () => {
|
||||||
:label="`ตอนที่`"
|
:label="`ตอนที่`"
|
||||||
:rules="[(val) => !!val || 'กรุณากรอกตอนที่']"
|
:rules="[(val) => !!val || 'กรุณากรอกตอนที่']"
|
||||||
/>
|
/>
|
||||||
<!-- <q-select
|
|
||||||
:disable="disbleStatus"
|
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกตอนที่']"
|
|
||||||
hide-bottom-space
|
|
||||||
:options="episodeOp"
|
|
||||||
class="col-xs-12 col-sm-6"
|
|
||||||
dense
|
|
||||||
borderless
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
outlined
|
|
||||||
v-model="episode"
|
|
||||||
emit-value
|
|
||||||
:label="`ตอนที่`"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -723,21 +570,6 @@ const searchcardid = () => {
|
||||||
:label="`หน้าที่`"
|
:label="`หน้าที่`"
|
||||||
:rules="[(val) => !!val || 'กรุณากรอกหน้าที่']"
|
:rules="[(val) => !!val || 'กรุณากรอกหน้าที่']"
|
||||||
/>
|
/>
|
||||||
<!-- <q-select
|
|
||||||
:disable="disbleStatus"
|
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกหน้าที่']"
|
|
||||||
hide-bottom-space
|
|
||||||
:options="dutyOp"
|
|
||||||
class="col-xs-12 col-sm-6"
|
|
||||||
dense
|
|
||||||
emit-value
|
|
||||||
borderless
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
outlined
|
|
||||||
v-model="duty"
|
|
||||||
:label="`หน้าที่`"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -752,36 +584,11 @@ const searchcardid = () => {
|
||||||
:label="`ลำดับที่`"
|
:label="`ลำดับที่`"
|
||||||
:rules="[(val) => !!val || 'กรุณากรอกลำดับที่']"
|
:rules="[(val) => !!val || 'กรุณากรอกลำดับที่']"
|
||||||
/>
|
/>
|
||||||
<!-- <q-select
|
|
||||||
:disable="disbleStatus"
|
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกลำดับที่']"
|
|
||||||
hide-bottom-space
|
|
||||||
:options="announcedOp"
|
|
||||||
class="col-xs-12 col-sm-6"
|
|
||||||
dense
|
|
||||||
emit-value
|
|
||||||
borderless
|
|
||||||
option-label="label"
|
|
||||||
option-value="value"
|
|
||||||
outlined
|
|
||||||
v-model="announced"
|
|
||||||
:label="`ลำดับที่`"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
||||||
<div class="col-12 text-weight-bold text-grey">
|
<div class="col-12 text-weight-bold text-grey">
|
||||||
ผลการจ่ายใบกำกับ
|
ผลการจ่ายใบกำกับ
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-xs-12 col-sm-4"> -->
|
|
||||||
<!-- :rules="[(val) => !!val || 'กรุณากรแกหมายเล่นใบกำกับ']" -->
|
|
||||||
<!-- <q-input
|
|
||||||
dense
|
|
||||||
borderless
|
|
||||||
outlined
|
|
||||||
v-model="invoice"
|
|
||||||
label="หมายเลขใบกํากับ"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<datepicker
|
<datepicker
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
|
|
@ -860,7 +667,9 @@ const searchcardid = () => {
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<div class="row justify-end">
|
<div class="row justify-end">
|
||||||
<q-btn label="บันทึก" @click="clickSave" color="public" />
|
<q-btn label="บันทึก" @click="clickSave" color="public"
|
||||||
|
><q-tooltip>บันทึก</q-tooltip></q-btn
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,17 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from '@/stores/mixin'
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
const mixin = useCounterMixin()
|
const mixin = useCounterMixin();
|
||||||
const { success, messageError,hideLoader,dialogConfirm } = mixin
|
const { success, messageError, hideLoader, dialogConfirm, showLoader } = mixin;
|
||||||
const fileUpload = ref<any>(null);
|
const fileUpload = ref<any>(null);
|
||||||
const reason = ref<string>("");
|
const reason = ref<string>("");
|
||||||
const file = ref<string>("");
|
|
||||||
const documentTitle = ref<string>("");
|
const documentTitle = ref<string>("");
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const filterDoc = ref<any>(null);
|
const filterDoc = ref<any>(null);
|
||||||
|
|
||||||
|
|
@ -55,9 +54,9 @@ const colums2 = ref<QTableProps["columns"]>([
|
||||||
const rows2 = ref<any>([]);
|
const rows2 = ref<any>([]);
|
||||||
|
|
||||||
interface TypeData {
|
interface TypeData {
|
||||||
fileName:string
|
fileName: string;
|
||||||
reason:string
|
reason: string;
|
||||||
pathName:string
|
pathName: string;
|
||||||
}
|
}
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
roundId: {
|
roundId: {
|
||||||
|
|
@ -66,41 +65,39 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const getRequest = async () => {
|
const getRequest = async () => {
|
||||||
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.requestDocNote(props.roundId as string))
|
.get(config.API.requestDocNote(props.roundId as string))
|
||||||
.then((res:any) =>{
|
.then((res: any) => {
|
||||||
console.log(res)
|
const data = res.data.result;
|
||||||
const data = res.data.result
|
data.map((item: TypeData) => {
|
||||||
console.log(data)
|
rows2.value.push({
|
||||||
data.map((item:TypeData) =>{
|
fileName: item.fileName,
|
||||||
rows2.value.push({
|
annotation: item.reason,
|
||||||
fileName:item.fileName,
|
file: item.pathName,
|
||||||
annotation:item.reason,
|
});
|
||||||
file:item.pathName
|
});
|
||||||
})
|
})
|
||||||
|
.catch((e) => {
|
||||||
}
|
|
||||||
)
|
|
||||||
console.log(rows2.value)
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const putRequest = () => {
|
const putRequest = async () => {
|
||||||
const dataAppend = new FormData()
|
showLoader();
|
||||||
dataAppend.append("Name",documentTitle.value)
|
const dataAppend = new FormData();
|
||||||
dataAppend.append("Reason",reason.value)
|
dataAppend.append("Name", documentTitle.value);
|
||||||
dataAppend.append("File",fileUpload.value)
|
dataAppend.append("Reason", reason.value);
|
||||||
http
|
dataAppend.append("File", fileUpload.value);
|
||||||
.put(config.API.requestDocNote(props.roundId as string),dataAppend)
|
await http
|
||||||
.then((res) => {
|
.put(config.API.requestDocNote(props.roundId as string), dataAppend)
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
.then(() => {
|
||||||
})
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
.catch((e) => {
|
})
|
||||||
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -110,10 +107,9 @@ const putRequest = () => {
|
||||||
getRequest();
|
getRequest();
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
onMounted(async() => {
|
onMounted(async () => {
|
||||||
console.log(props.roundId);
|
await getRequest();
|
||||||
await getRequest()
|
|
||||||
});
|
});
|
||||||
const resetFilterRef = () => {
|
const resetFilterRef = () => {
|
||||||
filterKeyword.value = "";
|
filterKeyword.value = "";
|
||||||
|
|
@ -126,8 +122,8 @@ const pagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
const save = () => {
|
const save = () => {
|
||||||
dialogConfirm($q,()=>putRequest())
|
dialogConfirm($q, () => putRequest());
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Transition>
|
<Transition>
|
||||||
|
|
@ -171,7 +167,9 @@ const save = () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 flex justify-end">
|
<div class="col-12 flex justify-end">
|
||||||
<q-btn label="บันทึก" @click="save" color="public" />
|
<q-btn label="บันทึก" @click="save" color="public">
|
||||||
|
<q-tooltip>บันทึก</q-tooltip></q-btn
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
@ -238,13 +236,15 @@ const save = () => {
|
||||||
{{ props.row.fileName }}
|
{{ props.row.fileName }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="annotation" :props="props">
|
<q-td key="annotation" :props="props">
|
||||||
{{ props.row.annotation !== null ? props.row.annotation:"-"}}
|
{{
|
||||||
|
props.row.annotation !== null ? props.row.annotation : "-"
|
||||||
|
}}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td auto-width>
|
<q-td auto-width>
|
||||||
<q-btn
|
<q-btn
|
||||||
type="a"
|
type="a"
|
||||||
:href="props.row.file"
|
:href="props.row.file"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
dense
|
dense
|
||||||
size="14px"
|
size="14px"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -63,10 +63,9 @@ const fecthRound = async () => {
|
||||||
}));
|
}));
|
||||||
selectRound.value = data[0].id;
|
selectRound.value = data[0].id;
|
||||||
roundYear.value = data[0].year;
|
roundYear.value = data[0].year;
|
||||||
// console.log(roundYear.value);
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -82,7 +81,7 @@ const fecthInsignia = async () => {
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
insigniaOp.value = await DataStore.insigniaOp.filter(
|
insigniaOp.value = await DataStore.insigniaOp.filter(
|
||||||
(x: any) => x.type == tab.value || x.type === ""
|
(x: any) => x.type == tab.value || x.type === ""
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -90,16 +89,13 @@ const fecthInsignia = async () => {
|
||||||
const fecthInsigniaType = async () => {
|
const fecthInsigniaType = async () => {
|
||||||
await http(config.API.insigniaType)
|
await http(config.API.insigniaType)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log(res);
|
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.fetchDatainsigniaType(data);
|
DataStore.fetchDatainsigniaType(data);
|
||||||
tab.value = DataStore.insigniaType[0].name;
|
tab.value = DataStore.insigniaType[0].name;
|
||||||
|
|
||||||
// fecthlistInsignia();
|
|
||||||
fecthInsignia();
|
fecthInsignia();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -159,7 +155,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
watch(tab, () => {
|
watch(tab, () => {
|
||||||
console.log(DataStore.insigniaOp);
|
|
||||||
insigniaOp.value = DataStore.insigniaOp.filter(
|
insigniaOp.value = DataStore.insigniaOp.filter(
|
||||||
(x: any) => x.type == tab.value || x.type === ""
|
(x: any) => x.type == tab.value || x.type === ""
|
||||||
);
|
);
|
||||||
|
|
@ -182,7 +177,6 @@ const fecthlistInsignia = async () => {
|
||||||
DataStore.listinsignia(data);
|
DataStore.listinsignia(data);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -542,31 +536,4 @@ const resetFilter = () => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.arrow {
|
|
||||||
transition: transform 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.arrow-active {
|
|
||||||
transition: transform 0.5s;
|
|
||||||
transform: rotate(-90deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-base {
|
|
||||||
background-color: #f3f3f398;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-enter-active,
|
|
||||||
.v-leave-active {
|
|
||||||
transition: opacity 0.5s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-enter-from,
|
|
||||||
.v-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flexsave {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, computed } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { QForm, useQuasar } from "quasar";
|
import { QForm, useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useAllocateDataStore } from "@/modules/07_insignia/storeAllocate";
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import type { DataOption } from "@/modules/04_registry/components/profileType";
|
import type { DataOption } from "@/modules/04_registry/components/profileType";
|
||||||
|
|
||||||
const DataStore = useAllocateDataStore();
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const myForm = ref<QForm>();
|
const myForm = ref<QForm>();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
@ -32,17 +30,17 @@ const returndate = ref<Date | null>();
|
||||||
const reason = ref<string>("");
|
const reason = ref<string>("");
|
||||||
const listPerson = ref<any>([]);
|
const listPerson = ref<any>([]);
|
||||||
const OrgList = ref<DataOption[]>([]);
|
const OrgList = ref<DataOption[]>([]);
|
||||||
const insigniaNoteProfileId = ref<string>("")
|
const insigniaNoteProfileId = ref<string>("");
|
||||||
|
|
||||||
const clearData = () => {
|
const clearData = () => {
|
||||||
receivedate.value = null
|
receivedate.value = null;
|
||||||
returndate.value = null
|
returndate.value = null;
|
||||||
OrganazationId.value = ""
|
OrganazationId.value = "";
|
||||||
roundNo.value = ""
|
roundNo.value = "";
|
||||||
cardid.value = ""
|
cardid.value = "";
|
||||||
fullName.value = ""
|
fullName.value = "";
|
||||||
brand.value = ""
|
brand.value = "";
|
||||||
reason.value = ""
|
reason.value = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -69,21 +67,21 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
selectRoundOption: {
|
selectRoundOption: {
|
||||||
type: Array
|
type: Array,
|
||||||
},
|
},
|
||||||
profileId: {
|
profileId: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: "",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
if (props.modal == true && props.roundId != 'all') {
|
if (props.modal == true && props.roundId != "all") {
|
||||||
roundNo.value = props.roundId
|
roundNo.value = props.roundId;
|
||||||
fecthlistInsignia()
|
fecthlistInsignia();
|
||||||
fetchOrgList()
|
fetchOrgList();
|
||||||
if (props.action == 'editData') {
|
if (props.action == "editData") {
|
||||||
fetchData()
|
fetchData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -98,10 +96,9 @@ const fecthlistInsignia = async () => {
|
||||||
await http
|
await http
|
||||||
.post(config.API.noteSearch(), data)
|
.post(config.API.noteSearch(), data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
listPerson.value = res.data.result
|
listPerson.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
// console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -116,17 +113,23 @@ const fetchOrgList = async () => {
|
||||||
.then(async (response: any) => {
|
.then(async (response: any) => {
|
||||||
const orgArr = response.data.result.map((e: any) => ({
|
const orgArr = response.data.result.map((e: any) => ({
|
||||||
id: e.organizationId,
|
id: e.organizationId,
|
||||||
name: e.organizationName
|
name: e.organizationName,
|
||||||
}))
|
}));
|
||||||
|
|
||||||
if (props.action == 'editData') {
|
if (props.action == "editData") {
|
||||||
OrgList.value = [{id: "00000000-0000-0000-0000-000000000000", name: 'สำนักนายกรัฐมนตรี'},...orgArr]
|
OrgList.value = [
|
||||||
|
{
|
||||||
|
id: "00000000-0000-0000-0000-000000000000",
|
||||||
|
name: "สำนักนายกรัฐมนตรี",
|
||||||
|
},
|
||||||
|
...orgArr,
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
OrgList.value = orgArr
|
OrgList.value = orgArr;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err)
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -138,10 +141,10 @@ const fetchData = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.insigniaManageBorrowById(props.profileId))
|
.get(config.API.insigniaManageBorrowById(props.profileId))
|
||||||
.then(async (response: any) => {
|
.then(async (response: any) => {
|
||||||
console.log(response.data.result)
|
console.log(response.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err)
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -152,12 +155,12 @@ const clickSave = async () => {
|
||||||
await myForm.value!.validate().then((result: boolean) => {
|
await myForm.value!.validate().then((result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
if (props.action == 'addData') {
|
if (props.action == "addData") {
|
||||||
await http
|
await http
|
||||||
.post(config.API.insigniaManageBorrow(), {
|
.post(config.API.insigniaManageBorrow(), {
|
||||||
borrowDate: receivedate.value,
|
borrowDate: receivedate.value,
|
||||||
borrowOrganizationId: OrganazationId.value,
|
borrowOrganizationId: OrganazationId.value,
|
||||||
insigniaNoteProfileId: insigniaNoteProfileId.value
|
insigniaNoteProfileId: insigniaNoteProfileId.value,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
|
@ -166,7 +169,7 @@ const clickSave = async () => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
clearData()
|
clearData();
|
||||||
props.closeAndFecth();
|
props.closeAndFecth();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -174,7 +177,7 @@ const clickSave = async () => {
|
||||||
.put(config.API.insigniaManageBorrowReturn(props.profileId), {
|
.put(config.API.insigniaManageBorrowReturn(props.profileId), {
|
||||||
returnDate: returndate.value,
|
returnDate: returndate.value,
|
||||||
returnOrganizationId: OrganazationId.value,
|
returnOrganizationId: OrganazationId.value,
|
||||||
returnReason: reason.value
|
returnReason: reason.value,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
|
@ -183,7 +186,7 @@ const clickSave = async () => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
clearData()
|
clearData();
|
||||||
props.closeAndFecth();
|
props.closeAndFecth();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -194,21 +197,23 @@ const clickSave = async () => {
|
||||||
|
|
||||||
const searchcardid = async () => {
|
const searchcardid = async () => {
|
||||||
if (cardid.value.length === 13) {
|
if (cardid.value.length === 13) {
|
||||||
const node = await listPerson.value.find((e: any) => e.citizenId === cardid.value);
|
const node = await listPerson.value.find(
|
||||||
|
(e: any) => e.citizenId === cardid.value
|
||||||
|
);
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
console.log("node", node)
|
console.log("node", node);
|
||||||
fullName.value = `${node.prefix} ${node.fullName}`
|
fullName.value = `${node.prefix} ${node.fullName}`;
|
||||||
brand.value = node.requestInsignia
|
brand.value = node.requestInsignia;
|
||||||
insigniaNoteProfileId.value = node.id
|
insigniaNoteProfileId.value = node.id;
|
||||||
} else notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
|
} else notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
clearData()
|
clearData();
|
||||||
props.close()
|
props.close();
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -216,39 +221,81 @@ const closeDialog = () => {
|
||||||
<q-card style="min-width: 900px" class="q-pb-md">
|
<q-card style="min-width: 900px" class="q-pb-md">
|
||||||
<q-toolbar class="q-py-md">
|
<q-toolbar class="q-py-md">
|
||||||
<q-toolbar-title class="text-h6">ยืม-คืนเครื่องราชฯ </q-toolbar-title>
|
<q-toolbar-title class="text-h6">ยืม-คืนเครื่องราชฯ </q-toolbar-title>
|
||||||
<q-btn icon="close" unelevated round dense @click="closeDialog"
|
<q-btn
|
||||||
style="color: #ff8080; background-color: #ffdede" />
|
icon="close"
|
||||||
|
unelevated
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
@click="closeDialog"
|
||||||
|
style="color: #ff8080; background-color: #ffdede"
|
||||||
|
><q-tooltip>ปิด</q-tooltip></q-btn
|
||||||
|
>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-form ref="myForm">
|
<q-form ref="myForm">
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
<div
|
||||||
<div v-if="props.action === 'addData'" class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="props.action === 'addData'"
|
||||||
|
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
|
||||||
|
>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<q-select v-model="roundNo" dense outlined lazy-rules hide-bottom-space
|
<q-select
|
||||||
:label="`${'รอบการขอเครื่องราชฯ'}`" emit-value map-options option-label="name"
|
v-model="roundNo"
|
||||||
:options="selectRoundOption" option-value="id" :readonly="false" :borderless="false"
|
dense
|
||||||
style="min-width: 150px" :rules="[
|
outlined
|
||||||
(val) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ',
|
lazy-rules
|
||||||
]" @update:model-value="fecthlistInsignia()" />
|
hide-bottom-space
|
||||||
</div>
|
:label="`${'รอบการขอเครื่องราชฯ'}`"
|
||||||
<div class="col-12 text-weight-bold text-grey">
|
emit-value
|
||||||
ข้อมูลผู้ยืม
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
:options="selectRoundOption"
|
||||||
|
option-value="id"
|
||||||
|
:readonly="false"
|
||||||
|
:borderless="false"
|
||||||
|
style="min-width: 150px"
|
||||||
|
:rules="[(val) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']"
|
||||||
|
@update:model-value="fecthlistInsignia()"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-12 text-weight-bold text-grey">ข้อมูลผู้ยืม</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-input :disable="roundNo == ''" hide-bottom-space outlined class="inputgreen" v-model="cardid" dense
|
<q-input
|
||||||
lazy-rules :rules="[
|
:disable="roundNo == ''"
|
||||||
|
hide-bottom-space
|
||||||
|
outlined
|
||||||
|
class="inputgreen"
|
||||||
|
v-model="cardid"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
:rules="[
|
||||||
(val: string) => !!val || `${'กรุณากรอก เลขบัตรประจำตัวประชาชน'}`,
|
(val: string) => !!val || `${'กรุณากรอก เลขบัตรประจำตัวประชาชน'}`,
|
||||||
(val: string) =>
|
(val: string) =>
|
||||||
val.length >= 13 ||
|
val.length >= 13 ||
|
||||||
`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,
|
`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,
|
||||||
]" label="เลขบัตรประจำตัวประชาชน" maxlength="13" mask="#############" @keyup="searchcardid" />
|
]"
|
||||||
<!-- :rules="[(val:any) =>val.length != 13 ||`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,]" -->
|
label="เลขบัตรประจำตัวประชาชน"
|
||||||
|
maxlength="13"
|
||||||
|
mask="#############"
|
||||||
|
@keyup="searchcardid"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-6">
|
<div class="col-xs-6 col-sm-6">
|
||||||
<q-input disable hide-bottom-space outlined dense lazy-rules class="inputgreen" borderless
|
<q-input
|
||||||
v-model="fullName" :label="`${'ชื่อ-นามสกุล'}`" />
|
disable
|
||||||
|
hide-bottom-space
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
class="inputgreen"
|
||||||
|
borderless
|
||||||
|
v-model="fullName"
|
||||||
|
:label="`${'ชื่อ-นามสกุล'}`"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
||||||
|
|
@ -256,12 +303,26 @@ const closeDialog = () => {
|
||||||
รายละเอียดการยืมเครื่องราชฯ
|
รายละเอียดการยืมเครื่องราชฯ
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-input v-model="brand" disable dense outlined lazy-rules hide-bottom-space
|
<q-input
|
||||||
:label="`${'เครื่องราชฯ'}`" />
|
v-model="brand"
|
||||||
|
disable
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'เครื่องราชฯ'}`"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<datepicker menu-class-name="modalfix" v-model="receivedate" :locale="'th'" autoApply borderless
|
<datepicker
|
||||||
:enableTimePicker="false" week-start="0">
|
menu-class-name="modalfix"
|
||||||
|
v-model="receivedate"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
borderless
|
||||||
|
:enableTimePicker="false"
|
||||||
|
week-start="0"
|
||||||
|
>
|
||||||
<template #year="{ year }">
|
<template #year="{ year }">
|
||||||
{{ year + 543 }}
|
{{ year + 543 }}
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -269,11 +330,24 @@ const closeDialog = () => {
|
||||||
{{ parseInt(value + 543) }}
|
{{ parseInt(value + 543) }}
|
||||||
</template>
|
</template>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<q-input dense borderless outlined :rules="[(val) => !!val || 'กรุณาเลือกวันที่']" hide-bottom-space
|
<q-input
|
||||||
:model-value="receivedate != null ? date2Thai(receivedate) : undefined
|
dense
|
||||||
" :label="`${'วันที่ยืม'}`" clearable>
|
borderless
|
||||||
|
outlined
|
||||||
|
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
|
||||||
|
hide-bottom-space
|
||||||
|
:model-value="
|
||||||
|
receivedate != null ? date2Thai(receivedate) : undefined
|
||||||
|
"
|
||||||
|
:label="`${'วันที่ยืม'}`"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="event" class="cursor-pointer" color="primary">
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
</q-icon>
|
</q-icon>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
@ -282,20 +356,40 @@ const closeDialog = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
|
<q-select
|
||||||
emit-value map-options outlined v-model="OrganazationId" :label="`เลือกหน่วยงาน`" />
|
hide-bottom-space
|
||||||
|
:options="OrgList"
|
||||||
|
dense
|
||||||
|
borderless
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
outlined
|
||||||
|
v-model="OrganazationId"
|
||||||
|
:label="`เลือกหน่วยงาน`"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs" v-if="props.action === 'editData'">
|
<div
|
||||||
|
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
|
||||||
|
v-if="props.action === 'editData'"
|
||||||
|
>
|
||||||
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
|
||||||
<div class="col-12 text-weight-bold text-grey">
|
<div class="col-12 text-weight-bold text-grey">
|
||||||
รายละเอียดการคืนเครื่องราชฯ
|
รายละเอียดการคืนเครื่องราชฯ
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<datepicker menu-class-name="modalfix" v-model="returndate" :locale="'th'" autoApply borderless
|
<datepicker
|
||||||
:enableTimePicker="false" week-start="0">
|
menu-class-name="modalfix"
|
||||||
|
v-model="returndate"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
borderless
|
||||||
|
:enableTimePicker="false"
|
||||||
|
week-start="0"
|
||||||
|
>
|
||||||
<template #year="{ year }">
|
<template #year="{ year }">
|
||||||
{{ year + 543 }}
|
{{ year + 543 }}
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -303,11 +397,24 @@ const closeDialog = () => {
|
||||||
{{ parseInt(value + 543) }}
|
{{ parseInt(value + 543) }}
|
||||||
</template>
|
</template>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<q-input dense borderless outlined :rules="[(val) => !!val || 'กรุณาเลือกวันที่']" hide-bottom-space
|
<q-input
|
||||||
:model-value="returndate != null ? date2Thai(returndate) : undefined
|
dense
|
||||||
" :label="`${'วันที่คืน'}`" clearable>
|
borderless
|
||||||
|
outlined
|
||||||
|
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
|
||||||
|
hide-bottom-space
|
||||||
|
:model-value="
|
||||||
|
returndate != null ? date2Thai(returndate) : undefined
|
||||||
|
"
|
||||||
|
:label="`${'วันที่คืน'}`"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="event" class="cursor-pointer" color="primary">
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
</q-icon>
|
</q-icon>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
@ -316,16 +423,37 @@ const closeDialog = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
|
<q-select
|
||||||
emit-value map-options outlined v-model="OrganazationId" :label="`เลือกหน่วยงานที่ส่งคืน`" />
|
hide-bottom-space
|
||||||
|
:options="OrgList"
|
||||||
|
dense
|
||||||
|
borderless
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
outlined
|
||||||
|
v-model="OrganazationId"
|
||||||
|
:label="`เลือกหน่วยงานที่ส่งคืน`"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input type="textarea" hide-bottom-space dense borderless option-label="name" option-value="id"
|
<q-input
|
||||||
emit-value map-options outlined v-model="reason" :label="`สาเหตุที่ส่งคืนเครื่องราชอิสริยาภรณ์`" />
|
type="textarea"
|
||||||
|
hide-bottom-space
|
||||||
|
dense
|
||||||
|
borderless
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
outlined
|
||||||
|
v-model="reason"
|
||||||
|
:label="`สาเหตุที่ส่งคืนเครื่องราชอิสริยาภรณ์`"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
|
|
@ -333,9 +461,11 @@ const closeDialog = () => {
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<div class="row justify-end">
|
<div class="row justify-end">
|
||||||
<q-btn label="บันทึก" @click="clickSave" color="public" />
|
<q-btn label="บันทึก" @click="clickSave" color="public">
|
||||||
|
<q-tooltip>บันทึก</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -11,17 +11,9 @@ import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main"
|
||||||
import type { QTableProps, QInput } from "quasar";
|
import type { QTableProps, QInput } from "quasar";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
// const router = useRouter();
|
|
||||||
const DataStore = useBrrowDataStore();
|
const DataStore = useBrrowDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const { showLoader, hideLoader, messageError } = mixin;
|
||||||
date2Thai,
|
|
||||||
dialogConfirm,
|
|
||||||
showLoader,
|
|
||||||
hideLoader,
|
|
||||||
messageError,
|
|
||||||
success,
|
|
||||||
} = mixin;
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const tab = ref<string>("");
|
const tab = ref<string>("");
|
||||||
|
|
||||||
|
|
@ -31,10 +23,8 @@ const selectRoundAllOption = ref<OptionDataYear[]>([]);
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const action = ref<string>("");
|
const action = ref<string>("");
|
||||||
const personId = ref<string>();
|
|
||||||
const profileId = ref<string>("");
|
const profileId = ref<string>("");
|
||||||
const roundYear = ref<any>();
|
const roundYear = ref<any>();
|
||||||
const insigniaListAll = ref<any>([]);
|
|
||||||
const insigniaList = ref<any>([]);
|
const insigniaList = ref<any>([]);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
@ -46,8 +36,6 @@ const fecthRound = async () => {
|
||||||
.get(config.API.noteround())
|
.get(config.API.noteround())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
selectRoundAllOption.value = [
|
selectRoundAllOption.value = [
|
||||||
{
|
{
|
||||||
name: "ทั้งหมด",
|
name: "ทั้งหมด",
|
||||||
|
|
@ -73,7 +61,7 @@ const fecthRound = async () => {
|
||||||
roundYear.value = data[0].year;
|
roundYear.value = data[0].year;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -81,7 +69,6 @@ const fecthInsignia = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.insignia)
|
.get(config.API.insignia)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log(res);
|
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.fetchDataInsignia(data);
|
DataStore.fetchDataInsignia(data);
|
||||||
})
|
})
|
||||||
|
|
@ -98,7 +85,6 @@ const fecthInsignia = async () => {
|
||||||
const fecthInsigniaType = async () => {
|
const fecthInsigniaType = async () => {
|
||||||
await http(config.API.insigniaType)
|
await http(config.API.insigniaType)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
// console.log(res);
|
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.fetchDatainsigniaType(data);
|
DataStore.fetchDatainsigniaType(data);
|
||||||
tab.value = DataStore.insigniaType[0].name;
|
tab.value = DataStore.insigniaType[0].name;
|
||||||
|
|
@ -316,7 +302,6 @@ const fecthlistInsignia = async () => {
|
||||||
rows.value = DataStore.rows;
|
rows.value = DataStore.rows;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -514,11 +499,7 @@ const resetFilter = () => {
|
||||||
:modal="modal"
|
:modal="modal"
|
||||||
:close="close"
|
:close="close"
|
||||||
:close-and-fecth="closeAndFecth"
|
:close-and-fecth="closeAndFecth"
|
||||||
:round-id="
|
:round-id="selectRound == '0' ? 'all' : selectRound"
|
||||||
selectRound == '00000000-0000-0000-0000-000000000000'
|
|
||||||
? 'all'
|
|
||||||
: selectRound
|
|
||||||
"
|
|
||||||
:action="action"
|
:action="action"
|
||||||
:profile-id="profileId"
|
:profile-id="profileId"
|
||||||
:select-round-option="selectRoundOption"
|
:select-round-option="selectRoundOption"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, watch } from "vue";
|
import { ref, onMounted, watch } from "vue";
|
||||||
// import { useRouter } from "vue-router";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -13,7 +12,6 @@ import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
|
||||||
import type { QTableProps, QInput } from "quasar";
|
import type { QTableProps, QInput } from "quasar";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
// const router = useRouter();
|
|
||||||
const DataStore = useResultDataStore();
|
const DataStore = useResultDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const {
|
||||||
|
|
@ -59,24 +57,22 @@ const fecthInsignia = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.insignia)
|
.get(config.API.insignia)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.fetchDatainsignia(data);
|
DataStore.fetchDatainsignia(data);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const fecthInsigniaType = async () => {
|
const fecthInsigniaType = async () => {
|
||||||
await http(config.API.insigniaType)
|
await http(config.API.insigniaType)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log(res);
|
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.fetchDatainsigniaType(data);
|
DataStore.fetchDatainsigniaType(data);
|
||||||
tab.value = DataStore.insigniaType[0].name;
|
tab.value = DataStore.insigniaType[0].name;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
|
|
@ -271,7 +267,6 @@ const uploadFile = async (event: any, action: string) => {
|
||||||
success($q, "อัพโหลดไฟล์สำเร็จ");
|
success($q, "อัพโหลดไฟล์สำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
|
|
@ -288,43 +283,6 @@ const uploadFile = async (event: any, action: string) => {
|
||||||
"ยืนยันการบันทึกรายการข้อมูล",
|
"ยืนยันการบันทึกรายการข้อมูล",
|
||||||
"ต้องการยืนยันรายการข้อมูลนี้หรื้อไม่ ?";
|
"ต้องการยืนยันรายการข้อมูลนี้หรื้อไม่ ?";
|
||||||
}
|
}
|
||||||
// console.log(selectRound.value);
|
|
||||||
|
|
||||||
// let id = selectRound.value.toString();
|
|
||||||
// if (action === "result") {
|
|
||||||
// const formdata = new FormData();
|
|
||||||
// formdata.append("file", event);
|
|
||||||
// await http
|
|
||||||
// .put(config.API.uploadfilereceice(id), formdata)
|
|
||||||
// .then(() => {
|
|
||||||
// success($q, "อัพโหลดไฟล์สำเร็จ");
|
|
||||||
// })
|
|
||||||
// .catch((err) => {
|
|
||||||
// console.log(err);
|
|
||||||
// messageError($q, err);
|
|
||||||
// })
|
|
||||||
// .finally(async () => {
|
|
||||||
// await fecthlistInsignia();
|
|
||||||
// fileResult.value = null;
|
|
||||||
// });
|
|
||||||
// } else if (action === "invoice") {
|
|
||||||
// const formdata = new FormData();
|
|
||||||
// formdata.append("file", event);
|
|
||||||
// await http
|
|
||||||
// .put(config.API.uploadfileinvoice(id), formdata)
|
|
||||||
// .then(() => {
|
|
||||||
// success($q, "อัพโหลดไฟล์สำเร็จ");
|
|
||||||
// })
|
|
||||||
// .catch((err) => {
|
|
||||||
// console.log(err);
|
|
||||||
// messageError($q, err);
|
|
||||||
// })
|
|
||||||
// .finally(async () => {
|
|
||||||
// await fecthlistInsignia();
|
|
||||||
// fileinvoice.value = null;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const filterRef = ref<QInput>();
|
const filterRef = ref<QInput>();
|
||||||
|
|
@ -482,7 +440,6 @@ const resetFilter = () => {
|
||||||
icon="mdi-upload"
|
icon="mdi-upload"
|
||||||
@click="perviewfile(fileResult, 'receice')"
|
@click="perviewfile(fileResult, 'receice')"
|
||||||
>
|
>
|
||||||
<!-- @click="uploadFile(fileResult, 'result')" -->
|
|
||||||
<q-tooltip
|
<q-tooltip
|
||||||
>อัพโหลดไฟล์บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์</q-tooltip
|
>อัพโหลดไฟล์บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์</q-tooltip
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue