no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-21 11:00:05 +07:00
parent d4a59110c0
commit 9ba0bf2468
5 changed files with 88 additions and 90 deletions

View file

@ -26,6 +26,8 @@ const myFormPosition = ref<any>();
const selected = ref<string>(""); const selected = ref<string>("");
const selectedFile = ref<string>(""); const selectedFile = ref<string>("");
const dataRespone = ref<any>(); const dataRespone = ref<any>();
const search = ref<string>("");
const filterRef = ref<any>(null);
// Set form field // Set form field
let dataForm = reactive({ let dataForm = reactive({
@ -105,14 +107,6 @@ const fetchplacementPosition = async () => {
}); });
}; };
const search = ref<string>("");
//reset Tree Filter
const filterRef = ref<any>(null);
// const resetFilter = () => {
// search.value = "";
// filterRef.value.focus();
// };
const props = defineProps({ const props = defineProps({
personalId: String, personalId: String,
modal: Boolean, modal: Boolean,
@ -122,10 +116,9 @@ const props = defineProps({
}, },
personal: Object, personal: Object,
}); });
// filter
const myFilterMethod = (node: any, filter: string) => { const myFilterMethod = (node: any, filter: string) => {
const filt = filter; const filt = filter;
return ( return (
// ((node.name && node.name == null) || !node.name) && // ((node.name && node.name == null) || !node.name) &&
(node.name && node.name.indexOf(filt) > -1) || (node.name && node.name.indexOf(filt) > -1) ||
@ -156,7 +149,7 @@ const validateData = async () => {
} }
}); });
}; };
//
const saveAppoint = async () => { const saveAppoint = async () => {
myFormPosition.value.validate().then(async (result: boolean) => { myFormPosition.value.validate().then(async (result: boolean) => {
if (result) { if (result) {
@ -170,31 +163,29 @@ const saveAppoint = async () => {
positionPathSideId: dataForm.positionPathSideId, positionPathSideId: dataForm.positionPathSideId,
positionTypeId: dataForm.positionTypeId, positionTypeId: dataForm.positionTypeId,
}; };
dialogConfirm($q, async () => {
showLoader(); showLoader();
await http await http
.post(config.API.placementPass(), dataAppoint) .post(config.API.placementPass(), dataAppoint)
.then(() => { .then(() => {
success($q, "บันทึกสำเร็จ"); success($q, "บันทึกสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
await closeAndClear(); await closeAndClear();
await fetchPublishFile(); await fetchPublishFile();
await loadTreeData(); await loadTreeData();
await fetchplacementPosition(); await fetchplacementPosition();
hideLoader(); hideLoader();
}); });
});
} }
}); });
}; };
const editDataStatus = ref<boolean>(false); const editDataStatus = ref<boolean>(false);
const clickEditRow = () => {
editDataStatus.value = true;
};
const closeModal = () => { const closeModal = () => {
if (editDataStatus.value == true) { if (editDataStatus.value == true) {
@ -221,7 +212,6 @@ const closeAndClear = async () => {
dataForm.positionLineId = ""; dataForm.positionLineId = "";
dataForm.positionPathSideId = ""; dataForm.positionPathSideId = "";
dataForm.positionTypeId = ""; dataForm.positionTypeId = "";
editDataStatus.value = false;
}; };
// //
const posNoOptions = ref<Object[]>([ const posNoOptions = ref<Object[]>([
@ -265,7 +255,7 @@ const positionLevelOptions = ref<Object[]>([
value: "", value: "",
}, },
]); ]);
//
const selectedPosition = async (data: any) => { const selectedPosition = async (data: any) => {
if (data.name == null && selected.value != data.keyId) { if (data.name == null && selected.value != data.keyId) {
editDataStatus.value = true; editDataStatus.value = true;
@ -366,7 +356,6 @@ watch(props, () => {
personal.value = data; personal.value = data;
}); });
} }
if ( if (
personal.value && personal.value &&
personal.value.draft === false && personal.value.draft === false &&
@ -385,7 +374,7 @@ watch(props, () => {
}); });
} }
}); });
//
function findByPerson(element: any): any { function findByPerson(element: any): any {
if ( if (
element.positionNumId && element.positionNumId &&
@ -406,6 +395,7 @@ function findByPerson(element: any): any {
} }
return null; return null;
} }
//
const clearPosition = () => { const clearPosition = () => {
dialogConfirm( dialogConfirm(
$q, $q,
@ -414,6 +404,7 @@ const clearPosition = () => {
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?" "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
); );
}; };
//
const postClearPosition = async () => { const postClearPosition = async () => {
showLoader(); showLoader();
await http await http
@ -421,7 +412,6 @@ const postClearPosition = async () => {
.then(() => { .then(() => {
success($q, "คืนตำแหน่งสำเร็จ"); success($q, "คืนตำแหน่งสำเร็จ");
}) })
.catch((e: Object) => { .catch((e: Object) => {
messageError($q, e); messageError($q, e);
}) })

View file

@ -172,7 +172,7 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
]); ]);
//
const convertBmaOfficer = (val: string) => { const convertBmaOfficer = (val: string) => {
switch (val) { switch (val) {
case "OFFICER": case "OFFICER":
@ -185,6 +185,7 @@ const convertBmaOfficer = (val: string) => {
return "บุคคลภายนอก"; return "บุคคลภายนอก";
} }
}; };
//
const convertContainStatus = (val: string) => { const convertContainStatus = (val: string) => {
switch (val) { switch (val) {
case "UN-CONTAIN": case "UN-CONTAIN":
@ -199,6 +200,7 @@ const convertContainStatus = (val: string) => {
return "-"; return "-";
} }
}; };
//
const convertDraft = (val: boolean) => { const convertDraft = (val: boolean) => {
switch (val) { switch (val) {
case false: case false:
@ -209,7 +211,7 @@ const convertDraft = (val: boolean) => {
return "-"; return "-";
} }
}; };
//
const getTable = async () => { const getTable = async () => {
showLoader(); showLoader();
await http await http
@ -253,10 +255,11 @@ const getTable = async () => {
rowsAll.value.push(rowData); rowsAll.value.push(rowData);
}); });
//
rows.value = roleAdmin rows.value = roleAdmin
? rowsAll.value ? rowsAll.value
: rowsAll.value.filter((x: any) => x.statusId != "CONTAIN"); : rowsAll.value.filter((x: any) => x.statusId != "CONTAIN");
//
rowsFilter.value = rows.value.filter( rowsFilter.value = rows.value.filter(
(e: any) => (e: any) =>
e.draft == "รอส่งตัว" && e.draft == "รอส่งตัว" &&
@ -273,6 +276,7 @@ const getTable = async () => {
}; };
const appointModal = ref<boolean>(false); const appointModal = ref<boolean>(false);
//
const saveDeferment = async () => { const saveDeferment = async () => {
myForm.value.validate().then(async (result: boolean) => { myForm.value.validate().then(async (result: boolean) => {
if (result) { if (result) {
@ -285,6 +289,7 @@ const saveDeferment = async () => {
} }
}); });
}; };
// post
const postDeferment = async () => { const postDeferment = async () => {
const formData = new FormData(); const formData = new FormData();
formData.append("personalId", personalId.value); formData.append("personalId", personalId.value);
@ -307,7 +312,7 @@ const postDeferment = async () => {
hideLoader(); hideLoader();
}); });
}; };
//
const saveDisclaim = async () => { const saveDisclaim = async () => {
myForm.value.validate().then(async (result: boolean) => { myForm.value.validate().then(async (result: boolean) => {
if (result) { if (result) {
@ -320,6 +325,7 @@ const saveDisclaim = async () => {
} }
}); });
}; };
// post
const postDisclaimf = async () => { const postDisclaimf = async () => {
const dataPost = { const dataPost = {
note: userNote.value, note: userNote.value,
@ -446,7 +452,6 @@ const clickCloseSendModal = () => {
const clickClose = async () => { const clickClose = async () => {
userNote.value = ""; userNote.value = "";
if (editRow.value == true) { if (editRow.value == true) {
dialogConfirm( dialogConfirm(
$q, $q,
@ -501,6 +506,7 @@ const selected = ref<any>([]);
const personal_selected = ref<any>([]); const personal_selected = ref<any>([]);
const filterlistAdd = ref<string>(""); const filterlistAdd = ref<string>("");
const paging = ref<boolean>(true); const paging = ref<boolean>(true);
//
const savelist = () => { const savelist = () => {
selected.value.map((e: any) => { selected.value.map((e: any) => {
personal_selected.value.push(e.personalId); personal_selected.value.push(e.personalId);
@ -528,16 +534,17 @@ const savelist = () => {
); );
} }
}; };
// popup
const handleModalAddListUpdate = (val: boolean) => { const handleModalAddListUpdate = (val: boolean) => {
modaladdlist.value = val; modaladdlist.value = val;
(selected.value = []), (personal_selected.value = []); (selected.value = []), (personal_selected.value = []);
}; };
//
const checkSelected = computed(() => { const checkSelected = computed(() => {
if (selected.value.length === 0) { if (selected.value.length === 0) {
return true; return true;
} }
}); });
const paginationLabel = (start: number, end: number, total: number) => { const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total; if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total; else return start + "-" + end + " ใน " + total;
@ -821,7 +828,7 @@ const pagination = ref({
:validate="validateData" :validate="validateData"
/> />
</q-form> </q-form>
<q-dialog v-model="modalDefermentDisclaim" persistent> <q-dialog v-model="modalDefermentDisclaim" persistent>
<q-card style="width: 800px"> <q-card style="width: 800px">
<q-form ref="myForm"> <q-form ref="myForm">

View file

@ -2,7 +2,6 @@
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue"; import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, useAttrs } from "vue"; import { ref, useAttrs } from "vue";
import { useQuasar } from "quasar"; import { QTooltip, useQuasar } from "quasar";
const $q = useQuasar(); const $q = useQuasar();
const attrs = ref<any>(useAttrs()); const attrs = ref<any>(useAttrs());
const paging = ref<boolean>(true); const paging = ref<boolean>(true);
@ -106,10 +106,6 @@ const paginationLabel = (start: string, end: string, total: string) => {
else return start + "-" + end + " ใน " + total; else return start + "-" + end + " ใน " + total;
}; };
const refresh = () => props.refresh(); const refresh = () => props.refresh();
const initialPagination = ref<any>({
// descending: false,
rowsPerPage: props.paging == true ? 25 : 0,
});
const emit = defineEmits([ const emit = defineEmits([
"update:inputfilter", "update:inputfilter",
@ -161,7 +157,9 @@ const updateModaladdlist = () => {
icon="mdi-account-arrow-right" icon="mdi-account-arrow-right"
@click="updateModaladdlist" @click="updateModaladdlist"
v-if="displayAdd" v-if="displayAdd"
/> >
<q-tooltip>งรายชอไปยงหนวยงาน</q-tooltip>
</q-btn>
</div> </div>
<q-space /> <q-space />
<div class="items-center" style="display: flex"> <div class="items-center" style="display: flex">

View file

@ -91,7 +91,7 @@ const fecthInsignia = async () => {
); );
}); });
}; };
// Tab // Tab
const fecthInsigniaType = async () => { const fecthInsigniaType = async () => {
await http(config.API.insigniaType) await http(config.API.insigniaType)
.then(async (res) => { .then(async (res) => {
@ -138,6 +138,8 @@ const columns = ref<QTableProps["columns"]>([
label: "ลำดับ", label: "ลำดับ",
field: "no", field: "no",
sortable: false, sortable: false,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
}, },
{ {
name: "citizenId", name: "citizenId",
@ -145,8 +147,8 @@ const columns = ref<QTableProps["columns"]>([
label: "เลขประจำตัวประชาชน", label: "เลขประจำตัวประชาชน",
field: "citizenId", field: "citizenId",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "name", name: "name",
@ -154,8 +156,8 @@ const columns = ref<QTableProps["columns"]>([
label: "ชื่อ - นามสกุล", label: "ชื่อ - นามสกุล",
field: "name", field: "name",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "employeeType", name: "employeeType",
@ -163,8 +165,8 @@ const columns = ref<QTableProps["columns"]>([
label: "สถานภาพ", label: "สถานภาพ",
field: "employeeType", field: "employeeType",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "type", name: "type",
@ -172,8 +174,8 @@ const columns = ref<QTableProps["columns"]>([
label: "ประเภทเครื่องราชฯ", label: "ประเภทเครื่องราชฯ",
field: "type", field: "type",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "dateReceive", name: "dateReceive",
@ -181,8 +183,8 @@ const columns = ref<QTableProps["columns"]>([
label: "วันที่ได้รับพระราชทาน", label: "วันที่ได้รับพระราชทาน",
field: "dateReceive", field: "dateReceive",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
@ -191,8 +193,8 @@ const columns = ref<QTableProps["columns"]>([
label: "วันที่ในราชกิจนุเบกษา", label: "วันที่ในราชกิจนุเบกษา",
field: "date", field: "date",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "volumeNo", name: "volumeNo",
@ -200,8 +202,8 @@ const columns = ref<QTableProps["columns"]>([
label: "เล่มที่ในราชกิจนุเบกษา", label: "เล่มที่ในราชกิจนุเบกษา",
field: "volumeNo", field: "volumeNo",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "section", name: "section",
@ -209,8 +211,8 @@ const columns = ref<QTableProps["columns"]>([
label: "ตอนที่ในราชกิจนุเบกษา", label: "ตอนที่ในราชกิจนุเบกษา",
field: "section", field: "section",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "page", name: "page",
@ -218,8 +220,8 @@ const columns = ref<QTableProps["columns"]>([
label: "หน้าในราชกิจนุเบกษา", label: "หน้าในราชกิจนุเบกษา",
field: "page", field: "page",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "number", name: "number",
@ -227,8 +229,8 @@ const columns = ref<QTableProps["columns"]>([
label: "ลำดับที่ในราชกิจจานุเบกษา", label: "ลำดับที่ในราชกิจจานุเบกษา",
field: "number", field: "number",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "vatnumber", name: "vatnumber",
@ -236,8 +238,8 @@ const columns = ref<QTableProps["columns"]>([
label: "หมายเลขใบกำกับ", label: "หมายเลขใบกำกับ",
field: "vatnumber", field: "vatnumber",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "datepay", name: "datepay",
@ -245,8 +247,8 @@ const columns = ref<QTableProps["columns"]>([
label: "วันที่จ่ายใบกำกับฯ", label: "วันที่จ่ายใบกำกับฯ",
field: "datepay", field: "datepay",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "typepay", name: "typepay",
@ -254,8 +256,8 @@ const columns = ref<QTableProps["columns"]>([
label: "รูปแบบการจ่าย", label: "รูปแบบการจ่าย",
field: "typepay", field: "typepay",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "address", name: "address",
@ -263,8 +265,8 @@ const columns = ref<QTableProps["columns"]>([
label: "ที่อยู่ที่จ่าย", label: "ที่อยู่ที่จ่าย",
field: "address", field: "address",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "borrowOrganization", name: "borrowOrganization",
@ -272,8 +274,8 @@ const columns = ref<QTableProps["columns"]>([
label: "หน่วยงานที่ยืม", label: "หน่วยงานที่ยืม",
field: "borrowOrganization", field: "borrowOrganization",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "borrowDate", name: "borrowDate",
@ -281,8 +283,8 @@ const columns = ref<QTableProps["columns"]>([
label: "วันที่ยืม", label: "วันที่ยืม",
field: "borrowDate", field: "borrowDate",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "returnOrganization", name: "returnOrganization",
@ -290,8 +292,8 @@ const columns = ref<QTableProps["columns"]>([
label: "หน่วยงานที่คืน", label: "หน่วยงานที่คืน",
field: "returnOrganization", field: "returnOrganization",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "returnDate", name: "returnDate",
@ -299,8 +301,8 @@ const columns = ref<QTableProps["columns"]>([
label: "วันที่คืน", label: "วันที่คืน",
field: "returnDate", field: "returnDate",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "returnReason", name: "returnReason",
@ -308,8 +310,8 @@ const columns = ref<QTableProps["columns"]>([
label: "เหตุผลการคืน", label: "เหตุผลการคืน",
field: "returnReason", field: "returnReason",
sortable: true, sortable: true,
sort: (a: string, b: string) => headerStyle: "font-size: 14px",
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), style: "font-size: 14px",
}, },
{ {
name: "action", name: "action",
@ -328,6 +330,7 @@ watch(tab, async () => {
}); });
const yearRound = ref<number>(); const yearRound = ref<number>();
//
const selectorRound = async (round: number) => { const selectorRound = async (round: number) => {
roundYear.value = round; roundYear.value = round;
await fecthlistInsignia(); await fecthlistInsignia();
@ -549,9 +552,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
:columns="columns" :columns="columns"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
:filter="filter" :filter="filter"
row-key="name" row-key="id"
:pagination-label="paginationLabel" :pagination-label="paginationLabel"
v-model:pagination="pagination" v-model:pagination="pagination"
:paging="true"
> >
<template v-slot:body-cell="props"> <template v-slot:body-cell="props">
<q-td :props="props"> <q-td :props="props">