แก้ไขรอบการเสนอขอพระราชทานเครื่องราช, รายการลาออก
This commit is contained in:
parent
fde0a3fd0b
commit
39636d0e08
2 changed files with 134 additions and 22 deletions
|
|
@ -145,6 +145,54 @@
|
|||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
ผลการพิจารณาของผู้บังคับบัญชา
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">สถานะ</div>
|
||||
<div class="col-12 text-detail">{{ "อนุมัติ/ยับยั้ง" }}</div>
|
||||
</div>
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">{{ date2Thai(new Date()) }}</div>
|
||||
</div>
|
||||
<div class="col-xs-12 row items-start">
|
||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
<div class="col-12 text-detail">{{ "ความคิดเห็นและเหตุผล" }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
ผลการพิจารณาของผู้มีอำนาจ
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">สถานะ</div>
|
||||
<div class="col-12 text-detail">{{ "อนุมัติ/ยับยั้ง" }}</div>
|
||||
</div>
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">{{ date2Thai(new Date()) }}</div>
|
||||
</div>
|
||||
<div class="col-xs-12 row items-start">
|
||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
<div class="col-12 text-detail">{{ "ความคิดเห็นและเหตุผล" }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
|
|
@ -486,19 +534,62 @@
|
|||
:close="closeModal"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<q-card-section class="q-p-sm q-gutter-md">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input
|
||||
hide-bottom-space
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
:rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
|
||||
:rules="[(val) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล']"
|
||||
v-model="reasonReign"
|
||||
:label="`${'กรอกเหตุผล'}`"
|
||||
:label="`${'กรอกความคิดเห็น/เหตุผล'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12" v-if="!actionPass">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateBreak"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<!-- :rules="[
|
||||
(val) => !!val || `${'กรุณาเลือก วันสุดท้ายที่ยับยั้ง'}`,
|
||||
]" -->
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
:model-value="
|
||||
dateBreak !== null ? date2Thai(dateBreak) : null
|
||||
"
|
||||
hide-bottom-space
|
||||
:label="`${' วันสุดท้ายที่ยับยั้ง'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
:style="
|
||||
edit
|
||||
? 'color: var(--q-primary)'
|
||||
: 'color: var(--q-grey)'
|
||||
"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<DialogFooter :editvisible="true" :save="conditionPopup" />
|
||||
|
|
@ -578,6 +669,7 @@ const status = ref<string>("");
|
|||
const modal = ref<boolean>(false);
|
||||
const actionPass = ref<boolean>(false);
|
||||
const reasonReign = ref<string>("");
|
||||
const dateBreak = ref<Date | null>(null);
|
||||
|
||||
const closeModal = () => (modal.value = false);
|
||||
const openModal = () => (modal.value = true);
|
||||
|
|
@ -633,6 +725,7 @@ const fetchData = async (id: string) => {
|
|||
|
||||
const popUp = (action: "pass" | "passNot") => {
|
||||
reasonReign.value = "";
|
||||
dateBreak.value = null;
|
||||
actionPass.value = action === "pass";
|
||||
openModal();
|
||||
// if (action === "pass") {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="clickBack"
|
||||
|
||||
/>
|
||||
{{
|
||||
edit
|
||||
|
|
@ -203,8 +202,15 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader,dialogConfirm } =
|
||||
mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
success,
|
||||
dateToISO,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
|
|
@ -219,9 +225,9 @@ const fileDocDataUpload = ref<File[]>([]);
|
|||
const roundInsig = ref<any>();
|
||||
const datelast = ref<number>(1);
|
||||
const options = ref([
|
||||
{label:"รอบที่ 1",value:1},
|
||||
{label:"รอบที่ 2",value:2}
|
||||
])
|
||||
{ label: "รอบที่ 1", value: 1 },
|
||||
{ label: "รอบที่ 2", value: 2 },
|
||||
]);
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
|
@ -238,7 +244,11 @@ const fetchData = async () => {
|
|||
const data = res.data.result;
|
||||
// const files = res.data.result.files;
|
||||
id.value = data.period_id;
|
||||
roundInsig.value = data.period_name;
|
||||
roundInsig.value =
|
||||
options.value.filter((r: any) => r.value == data.period_round)
|
||||
.length > 0
|
||||
? options.value.filter((r: any) => r.value == data.period_round)[0]
|
||||
: null;
|
||||
yearly.value = data.period_year;
|
||||
datelast.value = data.period_amount;
|
||||
dateStart.value = new Date(data.period_start);
|
||||
|
|
@ -268,9 +278,13 @@ const updateYear = async (e: number) => {
|
|||
|
||||
const editData = async (id: string) => {
|
||||
const formData = new FormData();
|
||||
formData.append("Name", roundInsig.value);
|
||||
formData.append("year", parseInt(yearly.value).toString());
|
||||
formData.append("Amount", datelast.value.toString());
|
||||
const name = `รอบการเสนอพระราชทานเครื่องราชรอบที่ ${
|
||||
roundInsig.value.value
|
||||
} ปี ${yearly.value + 543} `;
|
||||
formData.append("name", name);
|
||||
formData.append("year", yearly.value.toString());
|
||||
formData.append("amount", datelast.value.toString());
|
||||
formData.append("round", roundInsig.value.value);
|
||||
if (dateStart.value !== null) {
|
||||
formData.append("startDate", dateToISO(dateStart.value));
|
||||
}
|
||||
|
|
@ -295,9 +309,9 @@ const editData = async (id: string) => {
|
|||
});
|
||||
console.log(formData);
|
||||
};
|
||||
const checkSave = () => {
|
||||
dialogConfirm($q,()=> SaveData())
|
||||
}
|
||||
const checkSave = () => {
|
||||
dialogConfirm($q, () => SaveData());
|
||||
};
|
||||
const SaveData = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (success) => {
|
||||
|
|
@ -324,23 +338,28 @@ const SaveData = async () => {
|
|||
// return valueData;
|
||||
// };
|
||||
const updateDateRange = () => {
|
||||
// console.log("test")
|
||||
// console.log("test")
|
||||
if (roundInsig.value.value == 1) {
|
||||
dateStart.value = new Date(new Date().getFullYear(), 9, 1);
|
||||
dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29);
|
||||
console.log(1)
|
||||
console.log(1);
|
||||
} else if (roundInsig.value.value == 2) {
|
||||
dateStart.value = new Date(new Date().getFullYear(), 3, 29);
|
||||
dateEnd.value = new Date(new Date().getFullYear(), 4, 29);
|
||||
console.log(2)
|
||||
console.log(2);
|
||||
}
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("name", roundInsig.value);
|
||||
formData.append("year", parseInt(yearly.value).toString());
|
||||
const name = `รอบการเสนอพระราชทานเครื่องราชรอบที่ ${
|
||||
roundInsig.value.value
|
||||
} ปี ${yearly.value + 543} `;
|
||||
console.log(name);
|
||||
formData.append("name", name);
|
||||
formData.append("year", yearly.value.toString());
|
||||
formData.append("amount", datelast.value.toString());
|
||||
formData.append("round", roundInsig.value.value);
|
||||
if (dateStart.value !== null) {
|
||||
formData.append("startDate", dateToISO(dateStart.value));
|
||||
}
|
||||
|
|
@ -356,7 +375,7 @@ const addData = async () => {
|
|||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.listRoundInsignia("insignia"), formData)
|
||||
.post(config.API.listRoundInsignia(), formData)
|
||||
.then(async (res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue