Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-09-22 16:10:48 +07:00
commit 2f2bb3a670
20 changed files with 1555 additions and 1083 deletions

View file

@ -316,7 +316,7 @@
></selector>
</div> -->
<div class="col-12" v-if="announcementExam">
<div class="row q-col-gutter-x-sm">
<!-- <div class="row q-col-gutter-x-sm">
<div class="col-xs-12 col-sm-6 col-md-6">
<selector
outlined
@ -347,7 +347,7 @@
@update:model-value="(value:any) => selectOrganization(value)"
></selector>
</div>
</div>
</div> -->
<div class="col-12 q-mb-sm">
<q-separator size="5px" color="grey-2" />
</div>
@ -1049,7 +1049,7 @@ const filterPayment = ref<string>(""); //search data table
const filterPosition = ref<string>(""); //search data table
const edit = ref<boolean>(false);
const rowsPayment = ref<ResponsePayment[]>([]);
const rowsPosition = ref<ResponsePosition[]>([]);
const rowsPosition = ref<any>([]);
const visibleColumnsPayment = ref<String[]>([
"accountNumber",
"bankName",
@ -1152,16 +1152,18 @@ onMounted(async () => {
id.value = route.params.id.toString();
await fetchData();
} else {
pay.value = "";
edit.value = false;
}
await fetchOrganizationShortName();
if (
organizationShortName.value != null &&
organizationShortName.value.id != null
)
await fetchOrganizationOrganization(organizationShortName.value.id);
if (organizationName.value != null && organizationName.value.id != null)
await fetchPositionPath(organizationName.value.id);
// await fetchOrganizationShortName();
// if (
// organizationShortName.value != null &&
// organizationShortName.value.id != null
// )
// await fetchOrganizationOrganization(organizationShortName.value.id);
// if (organizationName.value != null && organizationName.value.id != null)
// await fetchPositionPath(organizationName.value.id);
await fetchPositionPath("test");
});
const clickBack = () => {
@ -1575,7 +1577,7 @@ const clickAddPosition = () => {
if (result) {
rowsPosition.value.push({
id: "00000000-0000-0000-0000-000000000000",
position: { id: "", name: "" },
position: null,
type: { id: "normol", name: "ทั่วไป" },
highDegree: false,
});

View file

@ -69,14 +69,14 @@ const downloadFile = (response: any, filename: string) => {
link.click();
document.body.removeChild(link);
};
const fileDownload = async (no: number, type: string) => {
const fileDownload = async (no: number, type: string, fileName: string) => {
showLoader();
await http
.get(config.API.reportTransferFile(no, type, id.value), {
responseType: "blob",
})
.then(async (res) => {
downloadFile(res, `_ครั้งที่.${type}`);
downloadFile(res, `${fileName}.${type}`);
})
.catch((e) => {
messageError($q, e);
@ -464,7 +464,7 @@ onMounted(async () => {
round
color="red"
icon="picture_as_pdf"
@click="fileDownload(props.row.no, 'pdf')"
@click="fileDownload(props.row.no, 'pdf', props.row.fileName)"
>
<q-tooltip>ไฟล PDF</q-tooltip>
</q-btn>
@ -474,7 +474,7 @@ onMounted(async () => {
round
color="blue"
icon="mdi-file-word"
@click="fileDownload(props.row.no, 'docx')"
@click="fileDownload(props.row.no, 'docx', props.row.fileName)"
>
<q-tooltip>ไฟล WORD</q-tooltip>
</q-btn>

View file

@ -0,0 +1,257 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const selected = ref<ResponseItems[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
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: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "statustext",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"organizationPositionOld",
"statustext",
]);
const props = defineProps({
modal: Boolean,
closeModal: Function,
getData: Function,
rows2: Array,
filterKeyword2: String,
});
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
//popup
const saveOrder = () => {
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
//
const Ordersave = async () => {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.dischargeReport, body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งปลดออกสำเร็จ");
props.closeModal?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
props.getData?.();
hideLoader();
});
};
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
};
//
const Reset = () => {
emit("update:filterKeyword2", "");
};
watchEffect(() => {
if (props.modal === true) {
selected.value = [];
}
});
</script>
<template>
<q-dialog v-model="props.modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่งปลดออก" :close="closeModal" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="positionLevel" :props="props">
{{ props.row.positionLevel }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
</div>
</q-td>
<q-td key="organization" :props="props">
<div class="table_ellipsis">
{{ props.row.organization }}
</div>
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="saveOrder"
:disable="checkSelected"
color="public"
/>
</q-card-actions>
</q-card>
</q-dialog>
</template>

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, computed, onMounted } from "vue";
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
@ -7,16 +7,9 @@ import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import http from "@/plugins/http";
import config from "@/app.config";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import DialogSendToCommand from "@/modules/06_retirement/components/Discharged/DialogSendToCommand.vue";
import type { ResponseData } from "@/modules/06_retirement/interface/response/discharged";
const selected = ref<ResponseData[]>([]);
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
@ -129,63 +122,6 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
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: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "statustext",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
@ -271,28 +207,6 @@ const deleteData = async (id: string) => {
});
};
//
const saveOrder = async () => {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.dischargeReport, body)
.then((any) => {
success($q, "ส่งไปออกคำสั่งโอนออกสำเร็จ");
closeModal();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getData();
hideLoader();
});
};
const pagination = ref({
sortBy: "createdAt",
descending: true,
@ -411,9 +325,6 @@ const pagination = ref({
>
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
<!-- <q-tooltip>
{{ props.row.organizationPositionOld }}
</q-tooltip> -->
</div>
</q-td>
<q-td
@ -423,9 +334,6 @@ const pagination = ref({
>
<div class="table_ellipsis">
{{ props.row.organization }}
<!-- <q-tooltip>
{{ props.row.organization }}
</q-tooltip> -->
</div>
</q-td>
<q-td
@ -462,120 +370,12 @@ const pagination = ref({
</div>
</div>
</q-card>
<q-dialog v-model="modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่งปลดออก" :close="closeModal" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
v-model="filterKeyword2"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="positionLevel" :props="props">
{{ props.row.positionLevel }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
</div>
</q-td>
<q-td key="organization" :props="props">
<div class="table_ellipsis">
{{ props.row.organization }}
</div>
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="saveOrder"
:disable="checkSelected"
color="public"
/>
</q-card-actions>
</q-card>
</q-dialog>
<DialogSendToCommand
v-model:modal="modal"
:closeModal="closeModal"
:rows2="rows2"
v-model:filterKeyword2="filterKeyword2"
:fecthlistRecevice="getData"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -0,0 +1,258 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const selected = ref<ResponseItems[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
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: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "statustext",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"positionNumberOld",
"organizationPositionOld",
"statustext",
]);
const props = defineProps({
modal: Boolean,
closeModal: Function,
getData: Function,
rows2: Array,
filterKeyword2: String,
});
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
//popup
const saveOrder = () => {
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
//
const Ordersave = async () => {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.outReport, body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งโอนออกสำเร็จ");
props.closeModal?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
props.getData?.();
hideLoader();
});
};
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
};
//
const Reset = () => {
emit("update:filterKeyword2", "");
};
watchEffect(() => {
if (props.modal === true) {
selected.value = [];
}
});
</script>
<template>
<q-dialog v-model="props.modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่งให้ออก" :close="closeModal" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="positionLevel" :props="props">
{{ props.row.positionLevel }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
</div>
</q-td>
<q-td key="organization" :props="props">
<div class="table_ellipsis">
{{ props.row.organization }}
</div>
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="saveOrder"
:disable="checkSelected"
color="public"
/>
</q-card-actions>
</q-card>
</q-dialog>
</template>

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, computed, onMounted } from "vue";
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
@ -7,16 +7,9 @@ import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import http from "@/plugins/http";
import config from "@/app.config";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import DialogSendToCommand from "@/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue";
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
const selected = ref<ResponseData[]>([]);
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
@ -42,14 +35,7 @@ const visibleColumns = ref<string[]>([
"createdAt",
"statustext",
]);
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"organizationPositionOld",
"statustext",
]); //
//
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
@ -122,63 +108,6 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
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: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "statustext",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
onMounted(async () => {
await getData();
});
@ -192,6 +121,7 @@ const openModalOrder = () => {
rows2.value = row;
};
//
const getData = async () => {
showLoader();
await http
@ -261,28 +191,6 @@ const deleteData = async (id: string) => {
});
};
//
const saveOrder = async () => {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.outReport, body)
.then(() => {
success($q, "ส่งไปออกคำสั่งโอนออกสำเร็จ");
closeModal();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getData();
hideLoader();
});
};
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
@ -409,9 +317,6 @@ const pagination = ref({
>
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
<!-- <q-tooltip>
{{ props.row.organizationPositionOld }}
</q-tooltip> -->
</div>
</q-td>
<q-td
@ -421,9 +326,6 @@ const pagination = ref({
>
<div class="table_ellipsis">
{{ props.row.organization }}
<!-- <q-tooltip>
{{ props.row.organization }}
</q-tooltip> -->
</div>
</q-td>
<q-td key="createdAt" :props="props">
@ -457,119 +359,12 @@ const pagination = ref({
</div>
</q-card>
<q-dialog v-model="modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่งให้ออก" :close="closeModal" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
v-model="filterKeyword2"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="positionLevel" :props="props">
{{ props.row.positionLevel }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
</div>
</q-td>
<q-td key="organization" :props="props">
<div class="table_ellipsis">
{{ props.row.organization }}
</div>
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="saveOrder"
:disable="checkSelected"
color="public"
/>
</q-card-actions>
</q-card>
</q-dialog>
<DialogSendToCommand
v-model:modal="modal"
:closeModal="closeModal"
:rows2="rows2"
v-model:filterKeyword2="filterKeyword2"
:fecthlistRecevice="getData"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -63,6 +63,7 @@ onMounted(async () => {
await getData();
});
//
const getData = async () => {
showLoader();
await http

View file

@ -3,13 +3,10 @@ import { ref, onMounted } from "vue";
import { useQuasar, QForm } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/exitInterview";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
@ -198,7 +195,7 @@ const fecthlist = async () => {
});
};
//
//
const saveAppoint = async () => {
await myForm.value!.validate().then(async (result: boolean) => {
if (result) {
@ -210,7 +207,7 @@ const saveAppoint = async () => {
await http
.put(config.API.AppointInterview(id.value), body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
success($q, "วันนัดหมายเพื่อทําการสัมภาษณ์การลาออกสำเร็จ");
closeModal();
})
.catch((e) => {

View file

@ -121,6 +121,7 @@ onMounted(async () => {
await getData();
});
//
const getData = async () => {
showLoader();
await http

View file

@ -0,0 +1,257 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const selected = ref<ResponseItems[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
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: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "statustext",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"organizationPositionOld",
"statustext",
]);
const props = defineProps({
modal: Boolean,
closeModal: Function,
getData: Function,
rows2: Array,
filterKeyword2: String,
});
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
//popup
const saveOrder = () => {
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
//
const Ordersave = async () => {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.expulsionReport, body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งโอนออกสำเร็จ");
props.closeModal?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
props.getData?.();
hideLoader();
});
};
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
};
//
const Reset = () => {
emit("update:filterKeyword2", "");
};
watchEffect(() => {
if (props.modal === true) {
selected.value = [];
}
});
</script>
<template>
<q-dialog v-model="props.modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่งไล่ออก" :close="closeModal" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="positionLevel" :props="props">
{{ props.row.positionLevel }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
</div>
</q-td>
<q-td key="organization" :props="props">
<div class="table_ellipsis">
{{ props.row.organization }}
</div>
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="saveOrder"
:disable="checkSelected"
color="public"
/>
</q-card-actions>
</q-card>
</q-dialog>
</template>

View file

@ -1,28 +1,20 @@
<script setup lang="ts">
import { ref, computed, onMounted } from "vue";
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import DialogSendToCommand from "@/modules/06_retirement/components/Expulsion/DialogSendToCommand.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import type { ResponseData } from "@/modules/06_retirement/interface/response/expulsion";
const selected = ref<ResponseData[]>([]);
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
const transferStore = useTransferDataStore();
const retirementStore = useRetirementDataStore();
const {
date2Thai,
@ -32,7 +24,7 @@ const {
success,
dialogRemove,
} = mixin;
const { statusText } = transferStore;
const { statusText } = retirementStore;
const modal = ref<boolean>(false);
const visibleColumns = ref<string[]>([
@ -44,14 +36,7 @@ const visibleColumns = ref<string[]>([
"createdAt",
"statustext",
]);
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"organizationPositionOld",
"statustext",
]); //
//
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
@ -129,62 +114,6 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
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: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "statustext",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
onMounted(async () => {
await getData();
@ -267,29 +196,6 @@ const deleteData = async (id: string) => {
});
};
//
const saveOrder = async () => {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.expulsionReport, body)
.then(() => {
success($q, "ส่งไปออกคำสั่งโอนออกสำเร็จ");
closeModal();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getData();
hideLoader();
});
};
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
const pagination = ref({
@ -410,9 +316,6 @@ const pagination = ref({
>
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
<!-- <q-tooltip>
{{ props.row.organizationPositionOld }}
</q-tooltip> -->
</div>
</q-td>
<q-td
@ -422,9 +325,6 @@ const pagination = ref({
>
<div class="table_ellipsis">
{{ props.row.organization }}
<!-- <q-tooltip>
{{ props.row.organization }}
</q-tooltip> -->
</div>
</q-td>
<q-td key="createdAt" :props="props">
@ -458,120 +358,12 @@ const pagination = ref({
</div>
</div>
</q-card>
<q-dialog v-model="modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่งไล่ออก" :close="closeModal" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
v-model="filterKeyword2"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="positionLevel" :props="props">
{{ props.row.positionLevel }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
</div>
</q-td>
<q-td key="organization" :props="props">
<div class="table_ellipsis">
{{ props.row.organization }}
</div>
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="saveOrder"
:disable="checkSelected"
color="public"
/>
</q-card-actions>
</q-card>
</q-dialog>
<DialogSendToCommand
v-model:modal="modal"
:closeModal="closeModal"
:rows2="rows2"
v-model:filterKeyword2="filterKeyword2"
:fecthlistRecevice="getData"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -0,0 +1,308 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const selected = ref<ResponseItems[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionTypeOld",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "positionTypeOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevelOld",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevelOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionNumberOld",
align: "left",
label: "เลขที่",
sortable: true,
field: "positionNumberOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "datetext",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "datetext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
sortOrder: "da",
},
{
name: "statustext",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"positionTypeOld",
"positionLevelOld",
"positionNumberOld",
"organizationPositionOld",
"datetext",
"statustext",
]);
const props = defineProps({
modal: Boolean,
closeModal: Function,
fecthlist: Function,
rows2: Array,
filterKeyword2: String,
});
//reset
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
//popup
const saveOrder = () => {
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
//
const Ordersave = async () => {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.resignReport, body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
props.closeModal?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
props.fecthlist?.();
hideLoader();
});
};
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
};
//
const Reset = () => {
emit("update:filterKeyword2", "");
};
watchEffect(() => {
if (props.modal === true) {
selected.value = [];
}
});
</script>
<template>
<q-dialog v-model="props.modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่งลาออก" :close="closeModal" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="prefix" :props="props">
{{ props.row.prefix }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="positionTypeOld" :props="props">
{{ props.row.positionTypeOld }}
</q-td>
<q-td key="positionLevelOld" :props="props">
{{ props.row.positionLevelOld }}
</q-td>
<q-td key="positionNumberOld" :props="props">
{{ props.row.positionNumberOld }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
</div>
</q-td>
<q-td key="datetext" :props="props">
{{ props.row.datetext }}
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="saveOrder"
:disable="checkSelected"
color="public"
/>
</q-card-actions>
</q-card>
</q-dialog>
</template>

View file

@ -4,7 +4,7 @@ import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import DialogSendToCommand from "@/modules/06_retirement/components/resign/DialogSendToCommand.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
@ -15,7 +15,7 @@ const { statusText } = RetirementData;
const $q = useQuasar(); // noti quasar
const router = useRouter();
const mixin = useCounterMixin();
const { messageError, date2Thai, showLoader, hideLoader, success } = mixin;
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
const rows = ref<ResponseItems[]>([]);
const columns = ref<QTableProps["columns"]>([
@ -135,109 +135,6 @@ const visibleColumns = ref<string[]>([
const filters = ref<ResponseItems[]>([]);
const rows2 = ref<ResponseItems[]>([]);
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionTypeOld",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "positionTypeOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevelOld",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevelOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionNumberOld",
align: "left",
label: "เลขที่",
sortable: true,
field: "positionNumberOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "datetext",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "datetext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
sortOrder: "da",
},
{
name: "statustext",
align: "left",
label: "สถานะ",
sortable: true,
field: "statustext",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"positionTypeOld",
"positionLevelOld",
"positionNumberOld",
"organizationPositionOld",
"datetext",
"statustext",
]);
const modal = ref<boolean>(false);
const filterKeyword2 = ref<string>("");
//
@ -245,14 +142,12 @@ const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
const selected = ref<ResponseItems[]>([]);
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
//
const closeModal = () => {
modal.value = false;
filterKeyword2.value = "";
};
const resetFilter = () => {
filterKeyword.value = "";
@ -317,30 +212,6 @@ const fecthlist = async () => {
hideLoader();
});
};
//
const saveOrder = async () => {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.resignReport, body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
closeModal();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fecthlist();
hideLoader();
});
};
const pagination = ref({
sortBy: "datetext",
descending: true,
@ -467,124 +338,12 @@ const pagination = ref({
</div>
</q-card>
<q-dialog v-model="modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่ง" :close="closeModal" />
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
v-model="filterKeyword2"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns2"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns2"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</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 key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="prefix" :props="props">
{{ props.row.prefix }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="positionTypeOld" :props="props">
{{ props.row.positionTypeOld }}
</q-td>
<q-td key="positionLevelOld" :props="props">
{{ props.row.positionLevelOld }}
</q-td>
<q-td key="positionNumberOld" :props="props">
{{ props.row.positionNumberOld }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
</div>
</q-td>
<q-td key="datetext" :props="props">
{{ props.row.datetext }}
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>
</d-table>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
label="ส่งไปออกคำสั่ง"
@click="saveOrder"
:disable="checkSelected"
color="public"
/>
</q-card-actions>
</q-card>
</q-dialog>
<DialogSendToCommand
v-model:modal="modal"
:closeModal="closeModal"
:rows2="rows2"
v-model:filterKeyword2="filterKeyword2"
:fecthlistRecevice="fecthlist"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -173,15 +173,15 @@ const fetchData = async (id: string) => {
hideLoader();
});
};
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
// const downloadFile = (response: any, filename: string) => {
// const link = document.createElement("a");
// var fileName = filename;
// link.href = window.URL.createObjectURL(new Blob([response.data]));
// link.setAttribute("download", fileName);
// document.body.appendChild(link);
// link.click();
// document.body.removeChild(link);
// };
const popUp = (action: "pass" | "passNot") => {
reasonReign.value = "";
@ -214,12 +214,10 @@ const confirmpopUp = async () => {
await http
.put(config.API.resignConfirm(roleUser.value, id.value), body)
.then(() => {
console.log("ยืนยัน");
success($q, "การอนุมัติสำเร็จ");
closeModal();
})
.catch((e) => {
console.log(e);
messageError($q, e);
})
.finally(() => {

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
import { onMounted, ref, computed, reactive } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useQuasar, QForm } from "quasar";
import type { QTableProps } from "quasar";
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
import { useroleUserDataStore } from "@/stores/roleUser";
@ -13,6 +13,7 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
import DialogHeader from "@/components/DialogHeader.vue";
import btnDownloadFile from "./downloadFile.vue";
const myForm = ref<QForm>();
const router = useRouter();
const mixin = useCounterMixin();
const {
@ -158,35 +159,48 @@ const columns2 = ref<QTableProps["columns"]>([
label: "ลำดับ",
field: "index",
align: "left",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "citizenId",
required: true,
label: "เลขประจำตัวประชาชน",
field: "citizenId",
align: "left",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "fullname",
required: true,
label: "ชื่อ-สกุล",
label: "ชื่อ-นามสกุล",
field: "fullname",
align: "left",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "position",
required: true,
label: "ตำแหน่งในสายงาน",
field: "position",
align: "left",
},
{
name: "level",
required: true,
label: "ระดับ",
field: "level",
align: "left",
},
{
name: "organizationOrganization",
required: true,
label: "สังกัด",
field: "organizationOrganization",
align: "left",
},
// {
// name: "position",
// required: true,
// label: "",
// field: "position",
// align: "left",
// },
// {
// name: "level",
// required: true,
// label: "",
// field: "level",
// align: "left",
// },
// {
// name: "organizationOrganization",
// required: true,
// label: "",
// field: "organizationOrganization",
// align: "left",
// },
]);
const rows2 = ref<any[]>([]);
@ -254,13 +268,12 @@ const changtypeOc = () => {
DataStore.typeOc = organization.value;
};
//
const clickmodalAdd = () => {
const clickmodalAdd = async () => {
let ocId = DataStore.typeOc ? DataStore.typeOc : DataStore.agency;
showLoader();
fecthInsignia();
fecthlistperson(ocId);
insigniaType.value = "";
await fecthInsignia();
await fecthlistperson(ocId);
clearForm();
};
//
const fecthlistperson = async (id: string) => {
@ -282,6 +295,7 @@ const fecthlistperson = async (id: string) => {
.then((res) => {
let data = res.data.result.map((e: any) => ({
id: e.id,
citizenId: e.citizenId,
fullname: e.fullname == null ? "-" : e.fullname,
position: e.position == null ? "-" : e.position,
level: e.positionEmployeeLevel == null ? "-" : e.positionEmployeeLevel,
@ -298,17 +312,21 @@ const fecthlistperson = async (id: string) => {
});
};
//
const clickAdd = async (id: string) => {
if (insigniaType.value !== "") {
dialogConfirm(
$q,
async () => {
await addlistperson(id);
},
"ยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ",
"ต้องการยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ นี้หรือไม่?"
);
} else dialogMessageNotify($q, "กรุณาเลือกประเภทเครื่องราชฯ");
const clickAdd = async () => {
dataPerson.id
? await myForm.value!.validate().then((result: boolean) => {
if (result) {
dialogConfirm(
$q,
async () => {
await addlistperson(dataPerson.id);
},
"ยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ",
"ต้องการยืนยันการเพิ่มรายชื่อคนที่ยื่นขอพระราชทานเครื่องราชฯ นี้หรือไม่?"
);
}
})
: dialogMessageNotify($q, "กรุณาเลือกราชชื่อที่ต้องการเพิ่ม");
};
//
const addlistperson = async (id: string) => {
@ -317,6 +335,7 @@ const addlistperson = async (id: string) => {
profileId: id,
insigniaId: insigniaType.value,
insigniaPeriodId: props.roundId,
reason: reason.value,
};
await http
.post(config.API.insigniaCreate(), data)
@ -497,6 +516,27 @@ const listdelete = async (id: string, reason: string) => {
await closemodelPopupDelete();
});
};
const dataPerson = reactive({
id: "",
position: "",
organizationOrganization: "",
level: "",
});
const reason = ref<string>("");
const selectPerson = (person) => {
dataPerson.id = person.id;
dataPerson.position = person.position;
dataPerson.organizationOrganization = person.organizationOrganization;
dataPerson.level = person.level;
};
const clearForm = () => {
dataPerson.id = "";
dataPerson.position = "";
dataPerson.organizationOrganization = "";
dataPerson.level = "";
reason.value = "";
insigniaType.value = "";
};
const insignia = ref<string>("");
const insigniaOptions = ref<any>([]);
@ -531,7 +571,7 @@ const pagination = ref({
rowsPerPage: 10,
});
const pagination2 = ref({
sortBy: "name",
sortBy: "fullname",
descending: false,
page: 1,
rowsPerPage: 10,
@ -863,7 +903,7 @@ const closeModalEdit = () => {
<!-- add -->
<q-dialog v-model="modalAdd">
<q-card style="width: 850px; max-width: 80vw" class="q-pb-md">
<q-card style="width: 800px; max-width: 80vw">
<q-toolbar class="q-py-md">
<q-toolbar-title class="text-h6">เพมรายช </q-toolbar-title>
@ -877,101 +917,163 @@ const closeModalEdit = () => {
/>
</q-toolbar>
<q-separator />
<div class="q-pa-md">
<q-toolbar style="padding: 0">
<q-select
v-model="insigniaType"
label="ประเภทเครื่องราชฯ"
dense
emit-value
map-options
:options="insigniaOptions"
option-value="id"
option-label="name"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 250px"
/>
<q-space />
<q-input
borderless
outlined
dense
debounce="300"
placeholder="ค้นหา"
v-model="filterKeyword2"
>
<!-- style="width: 850px; max-width: auto"? -->
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
</q-toolbar>
<q-table
flat
bordered
dense
:rows="rows2"
:columns="columns2"
:filter="filterKeyword2"
row-key="name"
class="custom-header-table"
:pagination-label="paginationLabel2"
v-model:pagination="pagination2"
>
<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-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td>{{ props.rowIndex + 1 }}</q-td>
<!-- <q-td key="order" :props="props">
{{ props.row.order }}
</q-td> -->
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
<q-td key="level" :props="props">{{ props.row.level }}</q-td>
<q-td key="organizationOrganization" :props="props">
{{ props.row.organizationOrganization }}
</q-td>
<q-td>
<q-btn
outline
:props="props"
label="เพิ่ม"
class="text-teal-5"
@click="clickAdd(props.row.id)"
/>
<q-tooltip>เพ</q-tooltip>
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
<q-pagination
v-model="pagination2.page"
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
</q-table>
</div>
<q-card-section class="q-pa-sm bg-grey-1">
<div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-sm-7">
<q-card flat bordered class="fit q-pa-sm">
<q-toolbar style="padding: 0">
<q-space />
<q-input
borderless
outlined
dense
debounce="300"
placeholder="ค้นหา"
v-model="filterKeyword2"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
</q-toolbar>
<q-table
flat
bordered
dense
:rows="rows2"
:columns="columns2"
:filter="filterKeyword2"
row-key="fullname"
class="custom-header-table"
:pagination-label="paginationLabel2"
v-model:pagination="pagination2"
>
<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-tr>
</template>
<template v-slot:body="props">
<q-tr
:props="props"
class="cursor-pointer"
:class="{ 'text-primary': props.row.id === dataPerson.id }"
@click="selectPerson(props.row)"
>
<q-td style="width: 75px">{{ props.rowIndex + 1 }}</q-td>
<q-td style="width: 250px" key="citizenId" :props="props">
{{ props.row.citizenId }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
<q-pagination
v-model="pagination2.page"
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
</q-table>
</q-card>
</div>
<div class="col-xs-12 col-sm-5">
<q-card flat bordered class="fit q-pa-sm">
<q-form ref="myForm">
<div class="q-pa-md">
<div class="row q-gutter-sm">
<div class="col-12">
<q-input
borderless
outlined
dense
label="ตำแหน่งในสายงาน"
placeholder="ตำแหน่งในสายงาน"
v-model="dataPerson.position"
readonly
/>
</div>
<div class="col-12">
<q-input
borderless
outlined
dense
label="สังกัด"
placeholder="สังกัด"
v-model="dataPerson.organizationOrganization"
readonly
/>
</div>
<div class="col-12">
<q-input
borderless
outlined
dense
label="ระดับ"
placeholder="ระดับ "
v-model="dataPerson.level"
readonly
/>
</div>
<div class="col-12">
<q-select
v-model="insigniaType"
label="ประเภทเครื่องราชฯ"
dense
emit-value
map-options
:options="insigniaOptions"
option-value="id"
option-label="name"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
:rules="[
(val) => !!val || `กรุณาเลือกประเภทเครื่องราช`,
]"
/>
</div>
<div class="col-12">
<q-input
type="textarea"
class="full-width inputgreen cursor-pointer"
hide-bottom-space
outlined
dense
lazy-rules
:rules="[(val) => !!val || `กรุณากรอกหมายเหตุ`]"
v-model="reason"
:label="`หมายเหตุ`"
/>
</div>
</div>
</div>
</q-form>
</q-card>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn dense unelevated label="บันทึก" color="public" @click="clickAdd">
<q-tooltip>นท</q-tooltip>
</q-btn>
</q-card-actions>
</q-card>
</q-dialog>

View file

@ -206,7 +206,15 @@ const popupBackToEdit = async () => {
const closeModalPopupBackToEdit = async () => {
modalPopupBackToEdit.value = false;
};
const modalbackInsignia2Role = ref<boolean>(false);
// popup admin
const popupBackToInsignia2Role = async () => {
modalbackInsignia2Role.value = true;
};
// popup admin
const closepopupBackToInsignia2Role = async () => {
modalbackInsignia2Role.value = false;
};
// requestStatus st3 insignia2Role
const backToEdit = async (reason: string) => {
dialogConfirm(
@ -241,7 +249,6 @@ const backToEdit = async (reason: string) => {
"ต้องการยืนยันการตีกลับใช่หรือไม่?"
);
};
// requestStatus st3 insignia2Role
const directorApproved = async () => {
dialogConfirm(
@ -271,6 +278,12 @@ const directorApproved = async () => {
"ต้องการยืนยันการอนุมัติใช่หรือไม่?"
);
};
// requestStatus st5 adminRole
const backToEditinsignia2Role = async () => {
dialogConfirm($q, async () => {
console.log("รอ API");
});
};
//
const requestSendNote = async () => {
var organization = await (DataStore.agency != null
@ -300,6 +313,22 @@ const requestSendNote = async () => {
});
});
};
//
const fileUpload = ref<any>(null);
const uploadFile = async (event: any) => {
dialogConfirm($q, () => {
const selectedFile = event;
const formdata = new FormData();
formdata.append("file", selectedFile);
console.log("uploadFile :รอ API"),
"ยืนยันการอัปโหลดไฟล์",
"ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?";
});
};
//
const downloadFile = async () => {
console.log("downloadFile : รอ API");
};
</script>
<template>
@ -443,6 +472,52 @@ const requestSendNote = async () => {
</q-tab-panels>
<!-- :role-user="roleUser" -->
<q-toolbar class="q-py-md text-right">
<q-file
v-if="roleDataStore.insignia1Role"
bg-color="white"
clearable
outlined
dense
v-model="fileUpload"
accept=".pdf"
:style="fileUpload === null ? 'width: 150px' : 'width: auto'"
label="อัปโหลดไฟล์"
>
<template v-slot:prepend>
<q-icon color="light-blue" name="attach_file" />
<q-tooltip>ปโหลดไฟล</q-tooltip>
</template>
</q-file>
<q-btn
flat
round
color="light-blue"
icon="upload"
@click="uploadFile(fileUpload)"
v-if="fileUpload !== null"
/>
<q-btn
size="md"
icon="mdi-download"
flat
round
color="primary"
@click="downloadFile"
v-if="roleDataStore.insignia1Role"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn
v-else
color="primary"
icon-right="mdi-download"
label="ดาวน์โหลดไฟล์"
@click="downloadFile"
outline
>
<q-tooltip>ดาวนโหลด</q-tooltip></q-btn
>
<q-space />
<q-btn
v-if="
@ -474,6 +549,15 @@ const requestSendNote = async () => {
class="q-px-md q-ml-md"
@click="directorApproved"
/>
<q-btn
v-if="requestStatus == 'st5' && roleDataStore.adminRole"
dense
unelevated
label="ตีกลับ"
color="orange"
class="q-px-md"
@click="popupBackToInsignia2Role"
/>
</q-toolbar>
<DialogPopupReason
@ -483,6 +567,13 @@ const requestSendNote = async () => {
:click-close="closeModalPopupBackToEdit"
:savaForm="backToEdit"
/>
<DialogPopupReason
:modal="modalbackInsignia2Role"
title="หมายเหตุการตีกลับssss"
label="หมายเหตุ"
:click-close="closepopupBackToInsignia2Role"
:savaForm="backToEditinsignia2Role"
/>
</q-card>
</template>

View file

@ -18,14 +18,14 @@ const nextPage = (type: string, title: string) => {
<div>
<q-card flat bordered class="col-12 q-mt-sm">
<div class="q-pa-md">
<q-item to="/insignia/report/report-01" dense class="hover-green">
<!-- <q-item to="/insignia/report/report-01" dense class="hover-green">
<q-item-section avatar>
<q-icon color="primary" name="mdi-file" size="xs" />
</q-item-section>
<q-item-section class="text-dark">
รายงาน ขร.1 - ขร.4
</q-item-section>
</q-item>
</q-item> -->
<q-item
clickable

View file

@ -5,6 +5,7 @@ import type { FormOrderPlacementMainData } from "@/modules/10_order/interface/re
import type {
DataOption,
DataOption1,
OrderResult,
} from "@/modules/10_order/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
@ -139,8 +140,8 @@ const OriginalDataFetch = async () => {
showLoader();
await http
.get(config.API.listOrder())
.then((res: any) => {
rows.value = res.data.result.map((e: any) => ({
.then((res) => {
rows.value = res.data.result.map((e: OrderResult) => ({
orderId: e.orderId,
Order: e.orderName,
OrderNum:
@ -155,7 +156,7 @@ const OriginalDataFetch = async () => {
orderTypeValue: e.orderTypeValue,
}));
})
.catch((e: any) => {
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
@ -240,13 +241,13 @@ const OrderStatusFilter = async () => {
};
//
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const filterRef = ref<HTMLInputElement | null>(null);
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
const attrs = ref<any>(useAttrs());
const attrs = ref<string | null>(useAttrs());
//
const searchFilterTable = async () => {
if (OrderType.value == "ทั้งหมด") {

View file

@ -6,6 +6,11 @@ import type { QForm } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import {
history,
ColumnData,
DataOptionInsigniaType,
} from "../interface/index/Main.ts";
const myForm = ref<QForm>();
const mixin = useCounterMixin();
@ -17,7 +22,7 @@ const props = defineProps({
OrderTypeOption: Object,
});
const OrderTypeOption = ref<any>([]);
const OrderTypeOption = ref<DataOptionInsigniaType[]>([]);
const modal = ref<boolean>(false);
const employeeClass = ref<string>("");
@ -25,7 +30,7 @@ const reportType = ref<string>("");
const reportYear = ref<number | null>();
const reportNo = ref<string>("");
const columns = ref<any["columns"]>([
const columns = ref<ColumnData[]>([
{
name: "no",
label: "ลำดับ",
@ -67,14 +72,14 @@ const columns = ref<any["columns"]>([
style: "font-size: 14px",
},
]);
const rows = ref<any>([]);
const rows = ref<history[]>([]);
// popup
const clickOpenpopup = () => {
modal.value = true;
employeeClass.value = "";
if (props.OrderTypeOption != undefined) {
OrderTypeOption.value = props.OrderTypeOption.filter(
(e: any) => e.name !== "ทั้งหมด"
(e: DataOptionInsigniaType) => e.name !== "ทั้งหมด"
);
reportType.value = OrderTypeOption.value[0].name;
let currentDate = new Date();
@ -99,7 +104,7 @@ const clickSearch = async () => {
.then((res) => {
let data = res.data.result;
if (data.length !== 0) {
rows.value = data.map((e: any) => ({
rows.value = data.map((e: history) => ({
id: e.id,
citizenId: e.citizenId,
name: e.fullName,

View file

@ -195,6 +195,50 @@ interface Assign {
createdAt: Date;
updatedAt: Date;
}
interface OrderResult {
fiscalYear: string
orderBy: string
orderById: string
orderByOrganization: string
orderDate: Date
orderId: string
orderName: string
orderNo: string
orderStatusName: string
orderStatusValue: string
orderTypeName: string
orderTypeValue: string
signatoryBy: string
signatoryPosition: string
}
interface history {
citizenId: string,
fullName: string,
id: string
posNo: string,
position: string
}
interface ColumnData {
name: string;
align: string;
label: string;
field: string;
headerStyle: string;
style: string;
}
interface DataOptionInsigniaType {
category: string;
commandCode: string;
createdAt: string;
createdFullName: string;
createdUserId: string;
id: string;
lastUpdateFullName: string;
lastUpdateUserId: string;
lastUpdatedAt: string | null;
name: string;
}
export type {
DataOption,
DataOptionInsignia,
@ -213,6 +257,10 @@ export type {
optionData,
Certificate,
Assign,
OrderResult,
history,
ColumnData,
DataOptionInsigniaType
};
export { AddressDataDefualt, FamilyDataDefualt };