ยืม-คืนเครื่องราชฯ
This commit is contained in:
parent
a6df50d483
commit
b7ed1e659f
2 changed files with 51 additions and 25 deletions
|
|
@ -55,6 +55,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "orgShortName",
|
||||
|
|
@ -64,6 +66,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "orgShortName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "posMasterNoPrefix",
|
||||
|
|
@ -73,6 +77,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "posMasterNoPrefix",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "posMasterNo",
|
||||
|
|
@ -82,6 +88,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "posMasterNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "posMasterNoSuffix",
|
||||
|
|
@ -91,6 +101,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "posMasterNoSuffix",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
|
|
@ -100,6 +112,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "posType",
|
||||
|
|
@ -120,6 +134,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
|
||||
{
|
||||
|
|
@ -133,19 +149,27 @@ const columns = ref<QTableProps["columns"]>([
|
|||
format(val, row) {
|
||||
return !val ? "-" : val;
|
||||
},
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "lastUpdatedAt",
|
||||
align: "left",
|
||||
label: "วันที่แก้ไข",
|
||||
field: "lastUpdatedAt",
|
||||
sortable: true,
|
||||
format(val, row) {
|
||||
return date2Thai(val);
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const pagination = ref({
|
||||
sortBy: "lastUpdatedAt",
|
||||
});
|
||||
|
||||
/**
|
||||
* function เรียกข้อมูลประวัติตำแหน่ง
|
||||
|
|
@ -167,9 +191,7 @@ function fetchHistoryPos(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ดูการเปลี่ยนแปลง modal เมื่อเป็น true จะเรียกเรียกข้อมูลประวัติตำแหน่ง
|
||||
*/
|
||||
/** ดูการเปลี่ยนแปลง modal เมื่อเป็น true จะเรียกเรียกข้อมูลประวัติตำแหน่ง*/
|
||||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
|
|
@ -198,6 +220,7 @@ watch(
|
|||
:columns="columns"
|
||||
row-key="id"
|
||||
no-data-label="ไม่มีข้อมูล"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
|
|||
|
|
@ -69,31 +69,31 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
|||
rows.value = [];
|
||||
let list = await data.map((e: any) => ({
|
||||
id: e.id,
|
||||
citizenId: e.citizenId,
|
||||
prefix: e.prefix,
|
||||
position: e.position,
|
||||
status: status(e.status),
|
||||
name: e.fullName,
|
||||
citizenId: e.citizenId ? e.citizenId : "-",
|
||||
prefix: e.prefix ? e.prefix : "",
|
||||
position: e.position ? e.position : "-",
|
||||
status: e.status ? status(e.status) : "-",
|
||||
name: e.fullName ? e.fullName : "-",
|
||||
type: `${e.requestInsignia} (${
|
||||
type.value.find((item) => item.name === e.requestInsignia)?.shortName ||
|
||||
""
|
||||
"-"
|
||||
})`,
|
||||
requestInsigniaId: e.requestInsigniaId,
|
||||
employeeType: profileType(e.profileType),
|
||||
profileType: e.profileType,
|
||||
dateReceive: date2Thai(e.dateReceive),
|
||||
date: date2Thai(e.date),
|
||||
volumeNo: e.volumeNo,
|
||||
section: e.section,
|
||||
page: e.page,
|
||||
number: e.no,
|
||||
vatnumber: e.number,
|
||||
datepay: date2Thai(e.datePayment),
|
||||
typepay: e.typePayment,
|
||||
address: e.address,
|
||||
borrowOrganization: e.borrowOrganization,
|
||||
requestInsigniaId: e.requestInsigniaId ? e.requestInsigniaId : "-",
|
||||
employeeType: e.profileType ? profileType(e.profileType) : "-",
|
||||
profileType: e.profileType ? e.profileType : "-",
|
||||
dateReceive: e.dateReceive ? date2Thai(e.dateReceive) : "-",
|
||||
date: e.date ? date2Thai(e.date) : "-",
|
||||
volumeNo: e.volumeNo ? e.volumeNo : "-",
|
||||
section: e.section ? e.section : "-",
|
||||
page: e.page ? e.page : "-",
|
||||
number: e.no ? e.no : "-",
|
||||
vatnumber: e.number ? e.number : "-",
|
||||
datepay: e.datePayment ? date2Thai(e.datePayment) : "-",
|
||||
typepay: e.typePayment ? e.typePayment : "-",
|
||||
address: e.address ? e.address : "-",
|
||||
borrowOrganization: e.borrowOrganization ? e.borrowOrganization : "-",
|
||||
borrowDate: e.borrowDate !== null ? date2Thai(e.borrowDate) : "-",
|
||||
returnOrganization: e.returnOrganization,
|
||||
returnOrganization: e.returnOrganization ? e.returnOrganization : "-",
|
||||
returnDate: e.returnDate !== null ? date2Thai(e.returnDate) : "-",
|
||||
returnReason: e.returnReason !== null ? e.returnReason : "-",
|
||||
}));
|
||||
|
|
@ -148,11 +148,14 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
|||
* @param val สถานภาพ
|
||||
*/
|
||||
function profileType(val: string) {
|
||||
switch (val) {
|
||||
const newVal = val.toLocaleLowerCase();
|
||||
switch (newVal) {
|
||||
case "officer":
|
||||
return "ข้าราชการ กทม.สามัญ";
|
||||
case "employee":
|
||||
return "ลูกจ้างประจำ";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue