ปรับ ui เครื่องราชฯ เหรียญจักรพรรดิมาลา (รอบการเสนอขอ)
This commit is contained in:
parent
6f951f6b29
commit
94e6134e56
9 changed files with 254 additions and 202 deletions
|
|
@ -337,7 +337,7 @@ const menuList = readonly<any[]>([
|
|||
role: "insignia",
|
||||
children: [
|
||||
{
|
||||
label: "รายการเสนอขอ",
|
||||
label: "รอบการเสนอขอ",
|
||||
path: "insigniaProposals",
|
||||
role: "insignia",
|
||||
},
|
||||
|
|
@ -370,7 +370,7 @@ const menuList = readonly<any[]>([
|
|||
role: "coin",
|
||||
children: [
|
||||
{
|
||||
label: "รายการเสนอขอ",
|
||||
label: "รอบการเสนอขอ",
|
||||
path: "coinProposals",
|
||||
role: "coin",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่ขอโอนไป",
|
||||
label: "หน่วยงานที่ขอย้ายไป",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -240,7 +240,7 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่ขอโอนไป",
|
||||
label: "หน่วยงานที่ขอย้ายไป",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ const organization = ref<string>("");
|
|||
const reason = ref<string>("");
|
||||
const status = ref<string>("");
|
||||
const date = ref<Date | null>(null);
|
||||
const salary = ref<string>("");
|
||||
const salaryNew = ref<string>("");
|
||||
const amount = ref<number>();
|
||||
const amountOld = ref<number>();
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const dateOfBirth = ref<Date>()
|
||||
|
|
@ -131,7 +131,8 @@ const getData = async () => {
|
|||
reason.value = data.reason;
|
||||
status.value = data.status;
|
||||
date.value = data.date;
|
||||
salary.value = data.salary;
|
||||
amount.value = data.amount;
|
||||
amountOld.value = data.amountOld;
|
||||
positionTypeOld.value = data.positionTypeOld;
|
||||
positionLevelOld.value = data.positionLevelOld;
|
||||
positionNumberOld.value = data.positionNumberOld;
|
||||
|
|
@ -178,6 +179,10 @@ const conditionSave = async () => {
|
|||
});
|
||||
}
|
||||
};
|
||||
const cancelBtn = () => {
|
||||
edit.value=!edit
|
||||
getData()
|
||||
}
|
||||
const saveData = async () => {
|
||||
const body = {
|
||||
educationOld: educationOld.value,
|
||||
|
|
@ -190,7 +195,8 @@ const saveData = async () => {
|
|||
positionTypeOld: positionTypeOld.value,
|
||||
positionLevelOld: positionLevelOld.value,
|
||||
positionNumberOld: positionNumberOld.value,
|
||||
amountOld: salary.value,
|
||||
amount: amount.value,
|
||||
amountOld: amountOld.value,
|
||||
dateOfBirth:dateOfBirth.value ,
|
||||
genderId:genderId.value ,
|
||||
nationality:nationality.value ,
|
||||
|
|
@ -348,7 +354,7 @@ onMounted(async () => {
|
|||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
@click="cancelBtn"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -454,7 +460,7 @@ onMounted(async () => {
|
|||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="salary"
|
||||
v-model="amountOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
|
|
@ -492,7 +498,7 @@ onMounted(async () => {
|
|||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="salaryNew"
|
||||
v-model="amount"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
@click="cancelBtn"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -429,6 +429,10 @@
|
|||
});
|
||||
}
|
||||
};
|
||||
const cancelBtn = () => {
|
||||
edit.value=!edit
|
||||
getData()
|
||||
}
|
||||
const saveData = async () => {
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
@click="cancelBtn"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -429,6 +429,10 @@ const conditionSave = async () => {
|
|||
});
|
||||
}
|
||||
};
|
||||
const cancelBtn = () => {
|
||||
edit.value=!edit
|
||||
getData()
|
||||
}
|
||||
const saveData = async () => {
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
|
|
|
|||
|
|
@ -24,12 +24,16 @@
|
|||
<div class="col-xs-12 col-sm-12 row">
|
||||
<q-separator />
|
||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||
<q-input
|
||||
<q-select
|
||||
class="col-10"
|
||||
dense
|
||||
outlined
|
||||
v-model="roundInsig"
|
||||
:options="options"
|
||||
option-value="value"
|
||||
option-label="label"
|
||||
label="รอบการเสนอขอพระราชทานเครื่องราชฯ"
|
||||
@update:model-value="updateDateRange"
|
||||
/>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -210,9 +214,12 @@ const dateEnd = ref<Date>(new Date());
|
|||
const yearly = ref<number>(new Date().getFullYear());
|
||||
const files = ref<any>();
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const roundInsig = ref<string>("");
|
||||
const roundInsig = ref<any>();
|
||||
const datelast = ref<number>(1);
|
||||
|
||||
const options = ref([
|
||||
{label:"ครั้งที่ 1",value:1},
|
||||
{label:"ครั้งที่ 2",value:2}
|
||||
])
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
|
@ -312,6 +319,18 @@ const checkSave = async () => {
|
|||
// };
|
||||
// return valueData;
|
||||
// };
|
||||
const updateDateRange = () => {
|
||||
// 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)
|
||||
} else if (roundInsig.value.value == 2) {
|
||||
dateStart.value = new Date(new Date().getFullYear(), 3, 29);
|
||||
dateEnd.value = new Date(new Date().getFullYear() + 1, 6, 28);
|
||||
console.log(2)
|
||||
}
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
const formData = new FormData();
|
||||
|
|
|
|||
|
|
@ -1,183 +1,3 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
@click="clickAdd()"
|
||||
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">
|
||||
<q-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="Order"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
:visible-columns="visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="round" :props="props" @click="clickEdit(props.row)">
|
||||
{{ props.row.round }}
|
||||
</q-td>
|
||||
<q-td key="year" :props="props" @click="clickEdit(props.row)">
|
||||
{{ props.row.year }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="startDate"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
{{ props.row.startDate }}
|
||||
</q-td>
|
||||
<q-td key="endDate" :props="props" @click="clickEdit(props.row)">
|
||||
{{ props.row.endDate }}
|
||||
</q-td>
|
||||
<q-td key="status" :props="props" @click="clickEdit(props.row)">
|
||||
<q-icon
|
||||
v-if="props.row.status == true"
|
||||
name="mdi-close"
|
||||
color="grey-5"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
name="mdi-check"
|
||||
color="positive"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td key="statusRoyal" :props="props">
|
||||
<q-icon
|
||||
v-if="props.row.statusRoyal == 'ยังไม่ได้เสนอ'"
|
||||
name="mdi-timer-sand"
|
||||
color="orange"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
name="mdi-check"
|
||||
color="positive"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="light-blue-8"
|
||||
@click.stop.prevent="clickProposals(props.row.file)"
|
||||
icon="mdi-file-download"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสารประกอบ </q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -216,7 +36,7 @@ const visibleColumns = ref<string[]>([
|
|||
"year",
|
||||
"startDate",
|
||||
"endDate",
|
||||
"status",
|
||||
// "status",
|
||||
"statusRoyal",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
|
|
@ -436,6 +256,187 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
@click="clickAdd()"
|
||||
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">
|
||||
<q-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="Order"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
:visible-columns="visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="round" :props="props" @click="clickEdit(props.row)">
|
||||
{{ props.row.round }}
|
||||
</q-td>
|
||||
<q-td key="year" :props="props" @click="clickEdit(props.row)">
|
||||
{{ props.row.year }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="startDate"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
{{ props.row.startDate }}
|
||||
</q-td>
|
||||
<q-td key="endDate" :props="props" @click="clickEdit(props.row)">
|
||||
{{ props.row.endDate }}
|
||||
</q-td>
|
||||
<q-td key="status" :props="props" @click="clickEdit(props.row)">
|
||||
<q-icon
|
||||
v-if="props.row.status == true"
|
||||
name="mdi-close"
|
||||
color="grey-5"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
name="mdi-check"
|
||||
color="positive"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td key="statusRoyal" :props="props">
|
||||
<q-icon
|
||||
v-if="props.row.statusRoyal == 'ยังไม่ได้เสนอ'"
|
||||
name="mdi-timer-sand"
|
||||
color="orange"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
name="mdi-check"
|
||||
color="positive"
|
||||
class="text-h5"
|
||||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="light-blue-8"
|
||||
@click.stop.prevent="clickProposals(props.row.file)"
|
||||
icon="mdi-file-download"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสารประกอบ </q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style lang="scss" scope>
|
||||
.filter-card {
|
||||
|
|
|
|||
|
|
@ -24,12 +24,16 @@
|
|||
<div class="col-xs-12 col-sm-12 row">
|
||||
<q-separator />
|
||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||
<q-input
|
||||
<q-select
|
||||
class="col-10"
|
||||
dense
|
||||
outlined
|
||||
v-model="roundCoin"
|
||||
label="รอบการเสนอขอพระราชทานเหรียญจักรพรรดิมาลา"
|
||||
:options="options"
|
||||
option-value="value"
|
||||
option-label="label"
|
||||
@update:model-value="updateDateRange"
|
||||
/>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -210,9 +214,12 @@ const dateEnd = ref<Date>(new Date());
|
|||
const yearly = ref<number>(new Date().getFullYear());
|
||||
const files = ref<any>();
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const roundCoin = ref<string>("");
|
||||
const roundCoin = ref<any>("");
|
||||
const datelast = ref<number>(1);
|
||||
|
||||
const options = ref([
|
||||
{label:"ครั้งที่ 1",value:1},
|
||||
{label:"ครั้งที่ 2",value:2}
|
||||
])
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
|
@ -336,7 +343,18 @@ const checkSave = async () => {
|
|||
// };
|
||||
// return valueData;
|
||||
// };
|
||||
|
||||
const updateDateRange = () => {
|
||||
// console.log("test")
|
||||
if (roundCoin.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)
|
||||
} else if (roundCoin.value.value == 2) {
|
||||
dateStart.value = new Date(new Date().getFullYear(), 3, 29);
|
||||
dateEnd.value = new Date(new Date().getFullYear() + 1, 6, 28);
|
||||
console.log(2)
|
||||
}
|
||||
};
|
||||
const addData = async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("name", roundCoin.value);
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ const visibleColumns = ref<string[]>([
|
|||
"year",
|
||||
"startDate",
|
||||
"endDate",
|
||||
"status",
|
||||
// "status",
|
||||
"statusRoyal",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue