Merge branch 'develop' into working

This commit is contained in:
Tanyalak 2023-08-22 17:14:51 +07:00
commit ef15eb9562
14 changed files with 361 additions and 130 deletions

View file

@ -192,8 +192,6 @@ const columns = ref<QTableProps["columns"]>([
field: "createdAt", field: "createdAt",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a, b) => (b.createdAt) - (a.createdAt)
}, },
{ {
name: "status", name: "status",
@ -337,6 +335,13 @@ const status = (val: string) => {
return "-"; return "-";
} }
}; };
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
@ -408,6 +413,8 @@ const status = (val: string) => {
:filter="filterKeyword" :filter="filterKeyword"
row-key="citizenId" row-key="citizenId"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
v-model:pagination="pagination"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -369,6 +369,12 @@ const status = (val: string) => {
return "-"; return "-";
} }
}; };
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center">รายการอนๆ</div> <div class="toptitle text-dark col-12 row items-center">รายการอนๆ</div>
@ -438,6 +444,7 @@ const status = (val: string) => {
:filter="filterKeyword" :filter="filterKeyword"
row-key="fullname" row-key="fullname"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
v-model:pagination="pagination"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -325,6 +325,12 @@ const closeModalTree = async () => {
onMounted(async () => { onMounted(async () => {
await getData(); await getData();
}); });
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center">รายการยาย</div> <div class="toptitle text-dark col-12 row items-center">รายการยาย</div>
@ -390,6 +396,7 @@ onMounted(async () => {
:filter="filterKeyword" :filter="filterKeyword"
row-key="id" row-key="id"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
v-model:pagination="pagination"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -8,7 +8,6 @@ import config from "@/app.config";
const $q = useQuasar(); const $q = useQuasar();
const myForm = ref<QForm>(); const myForm = ref<QForm>();
const edit = ref<boolean>(false);
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
date2Thai, date2Thai,
@ -21,13 +20,22 @@ const {
} = mixin; } = mixin;
const route = useRoute(); const route = useRoute();
const assignId = ref<string>(route.params.form.toString()); const assignId = ref<string>(route.params.form.toString());
const saveData = ref<boolean>(true)
const assign = ref<any>([]); const assign = ref<any>([]);
const mentors = ref<any>([]); const mentors = ref<any>([]);
const commander = ref<any>([]); const commander = ref<any>([]);
const status = ref<boolean>(true); const status = ref<boolean>(true);
// const evaluate = ref<any>([]); // const evaluate = ref<any>([]);
const saveEdit = (id: string) => {
dialogConfirm($q, () => console.log("save"));
};
const edit = () => {
status.value = true;
console.log(status.value);
};
const cancel = () => {
status.value = false;
};
onMounted(() => { onMounted(() => {
fecthAssign(assignId.value); fecthAssign(assignId.value);
fecthResult(assignId.value); fecthResult(assignId.value);
@ -81,6 +89,7 @@ const fecthResult = async (id: string) => {
director1_dated.value = data.director1_dated; director1_dated.value = data.director1_dated;
director2_dated.value = data.director2_dated; director2_dated.value = data.director2_dated;
status.value = false; status.value = false;
saveData.value = false;
}) })
.catch((e) => { .catch((e) => {
console.log(e); console.log(e);
@ -138,16 +147,49 @@ const postData = async () => {
</script> </script>
<template> <template>
<div class="row col-12 q-mr-md"> <div class="row col-12 q-ma-xs">
<q-form ref="myForm">
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
<div>แบบรายงานการประเมนฯ</div> <div>แบบรายงานการประเมนฯ</div>
<q-space />
<div v-if="status == false">
<q-btn
flat
round
color="primary"
@click="edit()"
icon="mdi-pencil-outline"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
</div>
<div v-else>
<q-btn flat round color="red" @click="cancel()" icon="mdi-undo">
<q-tooltip>ยกเล</q-tooltip>
</q-btn>
<q-btn
flat
round
color="public"
@click="saveEdit(assignId)"
icon="mdi-content-save-outline"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
</div> </div>
<div class="row col-12"> <div class="row col-12">
<div class="col-12 row q-col-gutter-md"> <div class="col-12 row q-col-gutter-md">
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<datepicker menu-class-name="modalfix" v-model="date_start" :locale="'th'" autoApply borderless <datepicker
:enableTimePicker="false" week-start="0"> menu-class-name="modalfix"
v-model="date_start"
:locale="'th'"
autoApply
borderless
:readonly ="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
@ -155,10 +197,23 @@ const postData = async () => {
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input outlined dense class="full-width datepicker" :model-value="date_start != null ? date2Thai(date_start) : null <q-input
" :label="`${'ระหว่างวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]"> outlined
dense
:disable="!status"
class="full-width datepicker"
:model-value="
date_start != null ? date2Thai(date_start) : null
"
:label="`${'ระหว่างวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> <q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -166,8 +221,16 @@ const postData = async () => {
</datepicker> </datepicker>
</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="date_finish" :locale="'th'" autoApply borderless <datepicker
:enableTimePicker="false" week-start="0"> menu-class-name="modalfix"
v-model="date_finish"
:locale="'th'"
autoApply
:readonly="!status"
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
@ -175,10 +238,23 @@ const postData = async () => {
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input outlined dense class="full-width datepicker" :model-value="date_finish != null ? date2Thai(date_finish) : null <q-input
" :label="`${'ถึงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]"> outlined
dense
:disable="!status"
class="full-width datepicker"
:model-value="
date_finish != null ? date2Thai(date_finish) : null
"
:label="`${'ถึงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> <q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -189,30 +265,70 @@ const postData = async () => {
</div> </div>
<div class="col-12 row q-mt-xs"> <div class="col-12 row q-mt-xs">
<div class="col-12 row q-col-gutter-md">
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-select :rules="[ <q-select
(val) => :rules="[
!!val || 'กรุณาเลือกการพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ', (val) =>
]" hide-bottom-space :options="options" class="col-xs-12 col-sm-6" dense borderless emit-value map-options !!val || 'กรุณาเลือกการพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ',
option-label="label" option-value="value" outlined v-model="develop" ]"
label="การพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ" /> hide-bottom-space
:options="options"
class="col-xs-12 col-sm-6"
dense
borderless
:disable="!status"
emit-value
map-options
option-label="label"
option-value="value"
outlined
v-model="develop"
label="การพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ"
/>
</div> </div>
</div> </div>
</div>
<div class="col-12 row q-mt-lg"> <div class="col-12 row q-mt-lg">
<div class="col-12 row q-col-gutter-md">
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-select :rules="[ <q-select
(val) => :rules="[
!!val || 'กรุณาเลือกผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ', (val) =>
]" hide-bottom-space :options="optionsResult" class="col-xs-12 col-sm-6" dense borderless emit-value !!val || 'กรุณาเลือกผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ',
map-options option-label="label" option-value="value" outlined v-model="result" ]"
label="ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ" /> hide-bottom-space
:options="optionsResult"
class="col-xs-12 col-sm-6"
:disable="!status"
dense
borderless
emit-value
map-options
option-label="label"
option-value="value"
outlined
v-model="result"
label="ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ"
/>
</div> </div>
</div> </div>
</div>
<div class="col-12 row q-mt-lg"> <div class="col-12 row q-mt-lg">
<div class="col-12"> <div class="col-12">
<q-input hide-bottom-space :readonly="edit" dense borderless :outlined="!edit" class="bg-white" type="textarea" <q-input
v-model="reson" label="เหตุผล" :rules="[(val) => !!val || 'กรุณาระบุเหตุผล']" /> hide-bottom-space
dense
borderless
outlined
:disable="!status"
class="bg-white"
type="textarea"
v-model="reson"
label="เหตุผล"
:rules="[(val) => !!val || 'กรุณาระบุเหตุผล']"
/>
</div> </div>
</div> </div>
@ -226,11 +342,27 @@ const postData = async () => {
ประธานคณะกรรมการประเมนผลการปฏหนาทราชการ ประธานคณะกรรมการประเมนผลการปฏหนาทราชการ
</div> </div>
<div class="col-12 row q-col-gutter-md"> <div class="col-12 row q-col-gutter-md">
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id" outlined :options="commander" label="" <q-select
option-label="name" disable /> class="col-xs-12 col-sm-8"
dense
v-model="director_id"
outlined
:options="commander"
label=""
option-label="name"
disable
/>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="chairman_dated" :locale="'th'" autoApply borderless <datepicker
:enableTimePicker="false" week-start="0"> menu-class-name="modalfix"
v-model="chairman_dated"
:locale="'th'"
:readonly="!status"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
@ -238,10 +370,23 @@ const postData = async () => {
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input outlined dense class="full-width datepicker col-3" :model-value="chairman_dated != null ? date2Thai(chairman_dated) : null <q-input
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"> outlined
dense
:disable="!status"
class="full-width datepicker col-3"
:model-value="
chairman_dated != null ? date2Thai(chairman_dated) : null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> <q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -257,11 +402,27 @@ const postData = async () => {
<!-- ความเหนของผอำนาจสงบรรจตามมาตรา 52 --> <!-- ความเหนของผอำนาจสงบรรจตามมาตรา 52 -->
</div> </div>
<div class="col-12 row q-col-gutter-md"> <div class="col-12 row q-col-gutter-md">
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id2" outlined :options="optionDirector" label="" <q-select
option-label="name" /> class="col-xs-12 col-sm-8"
dense
v-model="director_id2"
outlined
:disable="!status"
:options="optionDirector"
label=""
option-label="name"
/>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="director1_dated" :locale="'th'" autoApply borderless <datepicker
:enableTimePicker="false" week-start="0"> menu-class-name="modalfix"
v-model="director1_dated"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
@ -269,12 +430,25 @@ const postData = async () => {
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input outlined dense class="full-width datepicker col-3" :model-value="director1_dated != null <q-input
? date2Thai(director1_dated) outlined
: null dense
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"> :disable="!status"
class="full-width datepicker col-3"
:model-value="
director1_dated != null
? date2Thai(director1_dated)
: null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> <q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -290,11 +464,27 @@ const postData = async () => {
<!-- อำนาจสงบรรจตามมาตรา 52 --> <!-- อำนาจสงบรรจตามมาตรา 52 -->
</div> </div>
<div class="col-12 row q-col-gutter-md"> <div class="col-12 row q-col-gutter-md">
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id3" outlined :options="optionDirector" label="" <q-select
option-label="name" /> class="col-xs-12 col-sm-8"
dense
v-model="director_id3"
outlined
:options="optionDirector"
:disable="!status"
label=""
option-label="name"
/>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="director2_dated" :locale="'th'" autoApply borderless <datepicker
:enableTimePicker="false" week-start="0"> menu-class-name="modalfix"
v-model="director2_dated"
:locale="'th'"
autoApply
:readonly="!status"
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
@ -302,12 +492,25 @@ const postData = async () => {
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input outlined dense class="full-width datepicker col-3" :model-value="director2_dated != null <q-input
? date2Thai(director2_dated) outlined
: null dense
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"> :disable="!status"
class="full-width datepicker col-3"
:model-value="
director2_dated != null
? date2Thai(director2_dated)
: null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> <q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
@ -320,9 +523,13 @@ const postData = async () => {
<q-toolbar class="text-primary"> <q-toolbar class="text-primary">
<q-space /> <q-space />
<q-btn label="บันทึก" color="secondary" @click="savaForm" v-if="status" /> <q-btn
label="บันทึก"
color="secondary"
@click="savaForm"
v-if="!saveData"
/>
</q-toolbar> </q-toolbar>
</q-form>
</div> </div>
</template> </template>

View file

@ -407,8 +407,7 @@ const saveformdata = async (data: any) => {
<template> <template>
<div class="row col-12 q-gutter-lg no-margin"> <div class="row col-12 q-gutter-lg no-margin">
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
<div>แบบบนทกผล</div> <div>แบบบนทกผล</div>
<q-space/>
<q-space /> <q-space />
<div v-if="status == false"> <div v-if="status == false">
<q-btn <q-btn

View file

@ -302,6 +302,12 @@ const saveOrder = async () => {
hideLoader(); hideLoader();
}); });
}; };
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center">รายการปลดออก</div> <div class="toptitle text-dark col-12 row items-center">รายการปลดออก</div>
@ -367,6 +373,7 @@ const saveOrder = async () => {
:filter="filterKeyword" :filter="filterKeyword"
row-key="id" row-key="id"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
v-model:pagination="pagination"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -302,6 +302,12 @@ const saveOrder = async () => {
hideLoader(); hideLoader();
}); });
}; };
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center">รายการใหออก</div> <div class="toptitle text-dark col-12 row items-center">รายการใหออก</div>
@ -367,6 +373,7 @@ const saveOrder = async () => {
:filter="filterKeyword" :filter="filterKeyword"
row-key="id" row-key="id"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
v-model:pagination="pagination"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -303,6 +303,12 @@ const saveOrder = async () => {
hideLoader(); hideLoader();
}); });
}; };
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center">รายการไลออก</div> <div class="toptitle text-dark col-12 row items-center">รายการไลออก</div>
@ -368,6 +374,7 @@ const saveOrder = async () => {
:filter="filterKeyword" :filter="filterKeyword"
row-key="id" row-key="id"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
v-model:pagination="pagination"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">

View file

@ -125,17 +125,7 @@ const fectListDecased = async () => {
}); });
}; };
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: string, end: string, total: string) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
// //
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
@ -147,6 +137,12 @@ const resetFilter = () => {
const nextPage = (id: string) => { const nextPage = (id: string) => {
router.push("/deceased/" + id); router.push("/deceased/" + id);
}; };
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
@ -196,7 +192,7 @@ const nextPage = (id: string) => {
/> />
</div> </div>
<div class="col-12 q-pt-sm"> <div class="col-12 q-pt-sm">
<q-table <d-table
ref="table" ref="table"
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
@ -208,7 +204,6 @@ const nextPage = (id: string) => {
dense dense
class="custom-header-table" class="custom-header-table"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
:pagination-label="paginationLabel"
v-model:pagination="pagination" v-model:pagination="pagination"
> >
<template v-slot:header="props"> <template v-slot:header="props">
@ -257,19 +252,7 @@ const nextPage = (id: string) => {
</q-td> </q-td>
</q-tr> </q-tr>
</template> </template>
<template v-slot:pagination="scope"> </d-table>
<q-pagination
v-model="pagination.page"
active-color="primary"
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
</q-table>
</div> </div>
</div> </div>
</div> </div>

View file

@ -92,7 +92,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "insigniaType", name: "insigniaType",
align: "left", align: "left",
@ -175,7 +174,6 @@ const Note = ref<string>("");
const titleModal = ref<string>(""); const titleModal = ref<string>("");
const actionModal = ref<string>(""); const actionModal = ref<string>("");
const person = ref<any>([]); const person = ref<any>([]);
const props = defineProps({ const props = defineProps({
tab: { tab: {
type: String, type: String,
@ -192,12 +190,11 @@ 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;
organizationOptions.value = DataStore.optionsTypeOc; organizationOptions.value = DataStore.optionsTypeOc;
organization.value = organizationOptions.value[2].id;
DataStore.typeOc = organization.value;
// 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( props.fecthInsigniaByOc(
@ -218,6 +215,7 @@ const changtypeOc = () => {
props.tab props.tab
); );
} }
DataStore.typeOc = organization.value;
}; };
const clickmodalAdd = () => { const clickmodalAdd = () => {
showLoader(); showLoader();
@ -324,8 +322,8 @@ const addlistperson = async (id: string) => {
// modalNote.value = true; // modalNote.value = true;
// }; // };
const clickmodalEdit = (props: any) => { const clickmodalEdit = (props: any) => {
insignia.value = ""; insignia.value = props.insigniaSend;
insigniaType.value = ""; insigniaType.value = props.insigniaLevel;
person.value = props; person.value = props;
console.log(person.value); console.log(person.value);
modalEdit.value = true; modalEdit.value = true;
@ -616,9 +614,8 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
{{ props.row.level }} {{ props.row.level }}
</q-td> </q-td>
<q-td key="salary" :props="props"> <q-td key="salary" :props="props">
{{ props.row.salary }} {{ Number(props.row.salary).toLocaleString() }}
</q-td> </q-td>
<q-td key="insigniaType" :props="props"> <q-td key="insigniaType" :props="props">
{{ props.row.insigniaType }} {{ props.row.insigniaType }}
</q-td> </q-td>

View file

@ -133,8 +133,7 @@ const columns = ref<QTableProps["columns"]>([
onMounted(async () => { onMounted(async () => {
organizationOptions.value = DataStore.optionsTypeOc; organizationOptions.value = DataStore.optionsTypeOc;
organization.value = organizationOptions.value[0].id; organization.value = DataStore.typeOc;
DataStore.typeOc = organization.value;
// if (props.fecthInsigniaAll) { // if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab); // await props.fecthInsigniaAll(props.roundId, props.tab);
// } // }
@ -158,6 +157,7 @@ const changtypeOc = () => {
props.tab props.tab
); );
} }
DataStore.typeOc = organization.value;
}; };
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");

View file

@ -129,8 +129,7 @@ const columns = ref<QTableProps["columns"]>([
]); ]);
onMounted(async () => { onMounted(async () => {
organizationOptions.value = DataStore.optionsTypeOc; organizationOptions.value = DataStore.optionsTypeOc;
organization.value = organizationOptions.value[0].id; organization.value = DataStore.typeOc;
DataStore.typeOc = organization.value;
// if (props.fecthInsigniaAll) { // if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab); // await props.fecthInsigniaAll(props.roundId, props.tab);
// } // }
@ -154,6 +153,7 @@ const changtypeOc = () => {
props.tab props.tab
); );
} }
DataStore.typeOc = organization.value;
}; };
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");

View file

@ -48,7 +48,7 @@ const fecthlistRound = async () => {
year: e.period_year, year: e.period_year,
name: `รอบการเสนอพระราชทานเครื่องราช ${e.period_name} ปี ${e.period_year} `, name: `รอบการเสนอพระราชทานเครื่องราช ${e.period_name} ปี ${e.period_year} `,
})); }));
console.log(optionRound.value); // console.log(optionRound.value);
// const lastIndex = optionRound.value.length; // 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();
@ -95,21 +95,21 @@ const changround = () => {
fecthStat(round.value); fecthStat(round.value);
fecthInsigniaByOc(round.value, DataStore.typeOc, "officer", tab.value); fecthInsigniaByOc(round.value, DataStore.typeOc, "officer", tab.value);
}; };
const fecthInsigniaAll = async (periodId: string, tab: string) => { // const fecthInsigniaAll = async (periodId: string, tab: string) => {
// let data: any = []; // // let data: any = [];
// for (const item of DataStore.optionsTypeOc) { // // for (const item of DataStore.optionsTypeOc) {
// await http // // await http
// .get(config.API.insigniaList(periodId, item["id"], "officer", tab)) // // .get(config.API.insigniaList(periodId, item["id"], "officer", tab))
// .then((res) => { // // .then((res) => {
// // console.log(res); // // // console.log(res);
// data.push(res.data.result); // // data.push(res.data.result);
// }) // // })
// .catch((err) => { // // .catch((err) => {
// console.log(err); // // console.log(err);
// }); // // });
// } // // }
// console.log(data); // // console.log(data);
}; // };
const fecthInsigniaByOc = async ( const fecthInsigniaByOc = async (
roundId: string, roundId: string,
ocId: string, ocId: string,
@ -205,7 +205,6 @@ const fecthInsigniaByOc = async (
<tab1 <tab1
:tab="tab" :tab="tab"
:roundId="round" :roundId="round"
:fecthInsigniaAll="fecthInsigniaAll"
:fecthInsigniaByOc="fecthInsigniaByOc" :fecthInsigniaByOc="fecthInsigniaByOc"
/> />
</q-tab-panel> </q-tab-panel>
@ -213,7 +212,6 @@ const fecthInsigniaByOc = async (
<tab2 <tab2
:tab="tab" :tab="tab"
:roundId="round" :roundId="round"
:fecthInsigniaAll="fecthInsigniaAll"
:fecthInsigniaByOc="fecthInsigniaByOc" :fecthInsigniaByOc="fecthInsigniaByOc"
/> />
</q-tab-panel> </q-tab-panel>
@ -221,7 +219,6 @@ const fecthInsigniaByOc = async (
<tab3 <tab3
:tab="tab" :tab="tab"
:roundId="round" :roundId="round"
:fecthInsigniaAll="fecthInsigniaAll"
:fecthInsigniaByOc="fecthInsigniaByOc" :fecthInsigniaByOc="fecthInsigniaByOc"
/> />
</q-tab-panel> </q-tab-panel>

View file

@ -26,8 +26,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
name: e.fullName, name: e.fullName,
position: e.position, position: e.position,
level: e.rank, level: e.rank,
salary2: e.salary, salary: e.salary,
salary: Number(e.salary).toLocaleString(), salary2: Number(e.salary).toLocaleString(),
insigniaType: e.lastInsignia, insigniaType: e.lastInsignia,
insigniaSend: e.requestInsignia, insigniaSend: e.requestInsignia,
insigniaLevel: e.level, insigniaLevel: e.level,
@ -41,13 +41,19 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
} }
const filtertypeInsignia = async () => { const filtertypeInsignia = async () => {
typeinsignia.value = "all" typeinsignia.value = "all"
for (const data of listinsignia.value) { if (listinsignia.value.length !== 0) {
const Type = data.insigniaType; const double_name = [
if (Type !== null && !typeinsigniaValues.has(Type)) { ...new Set(listinsignia.value.map((item: any) => item.insigniaType)),
typeinsigniaOptions.value.push({ id: Type, name: Type }) ];
typeinsigniaValues.add(Type); for (let i = 1; i <= double_name.length; i++) {
} const type = double_name[i - 1];
} const listtype = {
id: type,
name: type,
};
typeinsigniaOptions.value.push(listtype)
}
} else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }]
}; };
const searchFilterTable = async () => { const searchFilterTable = async () => {
if (typeinsignia.value !== undefined && typeinsignia.value !== null) { if (typeinsignia.value !== undefined && typeinsignia.value !== null) {