2024-10-08 17:29:26 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, watch } from "vue";
|
|
|
|
|
import { useQuasar } from "quasar";
|
|
|
|
|
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
|
|
|
|
|
|
|
|
|
import type { QTableProps } from "quasar";
|
|
|
|
|
|
|
|
|
|
import DialogHeader from "@/components/DialogHeader.vue";
|
|
|
|
|
|
|
|
|
|
const $q = useQuasar();
|
|
|
|
|
const { dialogConfirm } = useCounterMixin();
|
|
|
|
|
|
|
|
|
|
const modal = defineModel<boolean>("modal", { required: true });
|
|
|
|
|
|
|
|
|
|
/** table*/
|
2024-10-15 16:16:59 +07:00
|
|
|
const selected = ref<any[]>([]);
|
2024-10-08 17:29:26 +07:00
|
|
|
const rows = ref<any[]>([
|
|
|
|
|
{
|
|
|
|
|
fullName: "นายศรัณย์ ศิลาดี",
|
|
|
|
|
position: "นักบริหาร",
|
|
|
|
|
posType: "บริหาร(สูง)",
|
|
|
|
|
organization: "",
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
const columns = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "fullName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ-นามสกุล",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "fullName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "position",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่งในสายงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "position",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "posType",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภทตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "posType",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "organization",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "สังกัด",
|
|
|
|
|
field: "organization",
|
|
|
|
|
sortable: true,
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
2024-10-15 16:16:59 +07:00
|
|
|
const isAcknowledge = ref<boolean>(false);
|
|
|
|
|
const isConsider = ref<boolean>(false);
|
|
|
|
|
const isComment = ref<boolean>(false);
|
|
|
|
|
|
2024-10-08 17:29:26 +07:00
|
|
|
function fetchLists() {}
|
|
|
|
|
|
|
|
|
|
function onSubmit() {
|
|
|
|
|
dialogConfirm($q, () => {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onCloseModal() {
|
|
|
|
|
modal.value = false;
|
|
|
|
|
selected.value = [];
|
|
|
|
|
rows.value = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
watch(modal, (val) => {
|
|
|
|
|
if (val) {
|
|
|
|
|
fetchLists();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<q-dialog v-model="modal" persistent>
|
|
|
|
|
<q-card style="min-width: 700px">
|
|
|
|
|
<q-form q-form greedy @submit.prevent @validation-success="onSubmit">
|
|
|
|
|
<DialogHeader :tittle="`เลือกรายชื่อ`" :close="onCloseModal" />
|
|
|
|
|
<q-separator />
|
|
|
|
|
|
|
|
|
|
<q-card-section>
|
|
|
|
|
<d-table
|
|
|
|
|
ref="table"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:rows="rows"
|
|
|
|
|
row-key="id"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
:paging="true"
|
|
|
|
|
dense
|
|
|
|
|
:rows-per-page-options="[10, 25, 50, 100]"
|
|
|
|
|
selection="single"
|
|
|
|
|
v-model:selected="selected"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header-selection="scope">
|
|
|
|
|
<q-checkbox
|
|
|
|
|
keep-color
|
|
|
|
|
color="primary"
|
|
|
|
|
dense
|
|
|
|
|
v-model="scope.checkBox"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th auto-width />
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td>
|
|
|
|
|
<q-checkbox
|
|
|
|
|
keep-color
|
|
|
|
|
color="primary"
|
|
|
|
|
dense
|
|
|
|
|
v-model="props.selected"
|
|
|
|
|
/>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<div>
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
2024-10-15 16:16:59 +07:00
|
|
|
</d-table>
|
|
|
|
|
<div class="q-gutter-xs q-pt-sm">
|
|
|
|
|
<div>
|
|
|
|
|
<q-checkbox
|
|
|
|
|
keep-color
|
|
|
|
|
color="primary"
|
|
|
|
|
dense
|
|
|
|
|
v-model="isAcknowledge"
|
|
|
|
|
label="ให้เลือกรับทราบ"
|
|
|
|
|
@update:model-value="(isConsider = false), (isComment = false)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="!isAcknowledge">
|
|
|
|
|
<q-checkbox
|
|
|
|
|
dense
|
|
|
|
|
keep-color
|
|
|
|
|
color="primary"
|
|
|
|
|
v-model="isConsider"
|
|
|
|
|
label="ให้เลือกพิจารณา (อนุมัติ/ไม่อนุมัติ)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="!isAcknowledge">
|
|
|
|
|
<q-checkbox
|
|
|
|
|
dense
|
|
|
|
|
keep-color
|
|
|
|
|
color="primary"
|
|
|
|
|
v-model="isComment"
|
|
|
|
|
label="ให้แสดงความเห็นในเอกสาร"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
2024-10-08 17:29:26 +07:00
|
|
|
|
|
|
|
|
<q-separator />
|
|
|
|
|
|
|
|
|
|
<q-card-actions align="right">
|
|
|
|
|
<q-btn
|
2024-10-15 16:16:59 +07:00
|
|
|
label="ส่งไปยังผู้บังคับบัญชา/ผู้มีอำนาจ"
|
2024-10-08 17:29:26 +07:00
|
|
|
color="public"
|
|
|
|
|
type="submit"
|
2024-10-15 16:16:59 +07:00
|
|
|
:disable="
|
|
|
|
|
selected.length === 0 ||
|
|
|
|
|
(!isAcknowledge && !isConsider && !isComment)
|
|
|
|
|
"
|
2024-10-08 17:29:26 +07:00
|
|
|
>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-card-actions>
|
|
|
|
|
</q-form>
|
|
|
|
|
</q-card>
|
|
|
|
|
</q-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|