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