แก้ไข TAB เครื่องราชฯ ปรับ Table

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-07 16:05:25 +07:00
parent b18056a335
commit a1bd65f1ca
13 changed files with 87 additions and 10 deletions

View file

@ -225,6 +225,7 @@ onMounted(async () => {
"officer", "officer",
props.tab props.tab
); );
DataStore.mainTab = props.tab;
} }
} }
}); });

View file

@ -157,6 +157,7 @@ onMounted(async () => {
"officer", "officer",
props.tab props.tab
); );
DataStore.mainTab = props.tab;
} }
} }
}); });

View file

@ -143,6 +143,7 @@ const columns = ref<QTableProps["columns"]>([
}, },
]); ]);
onMounted(async () => { onMounted(async () => {
organizationOptions.value = DataStore.optionsTypeOc; organizationOptions.value = DataStore.optionsTypeOc;
organization.value = await (DataStore.agency != null organization.value = await (DataStore.agency != null
? DataStore.agency ? DataStore.agency
@ -156,6 +157,7 @@ onMounted(async () => {
"officer", "officer",
props.tab props.tab
); );
DataStore.mainTab = props.tab;
} }
} }
}); });

View file

@ -5,10 +5,12 @@ import { useQuasar } from "quasar";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const DataStore = useInsigniaDataStore();
const props = defineProps({ const props = defineProps({
roundId: { roundId: {
type: String, type: String,
@ -44,6 +46,7 @@ const rows = ref<any[]>([]);
onMounted(async () => { onMounted(async () => {
await fecthOrg(); await fecthOrg();
DataStore.mainTab = props.tab;
}); });
watch(props, async () => { watch(props, async () => {
if (props.tab === "organization") { if (props.tab === "organization") {

View file

@ -30,7 +30,7 @@ const round = ref<string>("");
const roundName = ref<string>(""); const roundName = ref<string>("");
const optionRound = ref<any>([]); const optionRound = ref<any>([]);
const optiontypeOc = ref<any>([]); const optiontypeOc = ref<any>([]);
const tab = ref<any>("pending"); const tab = ref<any>("");
const stat = ref<any>({ const stat = ref<any>({
allUserUser: 0, allUserUser: 0,
orgAllCount: 0, orgAllCount: 0,
@ -39,6 +39,7 @@ const stat = ref<any>({
}); });
onMounted(async () => { onMounted(async () => {
tab.value = DataStore.mainTab;
await checkRole(); await checkRole();
await fecthlistRound(); await fecthlistRound();
}); });

View file

@ -408,6 +408,7 @@ const searchcardid = () => {
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="disbleStatus || status == 'DONE'"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
@ -495,6 +496,7 @@ const searchcardid = () => {
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="disbleStatus || status == 'DONE'"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}

View file

@ -94,11 +94,16 @@ const fecthInsignia = async () => {
}; };
const fecthInsigniaType = async () => { const fecthInsigniaType = async () => {
console.log(DataStore.mainTab);
await http(config.API.insigniaType) await http(config.API.insigniaType)
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
DataStore.fetchDatainsigniaType(data); DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name; if (DataStore.mainTab) {
tab.value = DataStore.mainTab;
} else tab.value = DataStore.insigniaType[0].name;
loadView.value = true; loadView.value = true;
fecthInsignia(); fecthInsignia();
}) })
@ -177,6 +182,7 @@ const selectorRound = (round: string) => {
}; };
const fecthlistInsignia = async () => { const fecthlistInsignia = async () => {
DataStore.mainTab = tab.value;
showLoader(); showLoader();
await http await http
.get(config.API.insigniaManageType(tab.value, Number(roundYear.value))) .get(config.API.insigniaManageType(tab.value, Number(roundYear.value)))

View file

@ -114,6 +114,9 @@ const visibleColumns = ref<String[]>([
"name", "name",
"type", "type",
"employeeType", "employeeType",
"date",
"volumeNo",
"section",
"page", "page",
"number", "number",
"vatnumber", "vatnumber",
@ -155,6 +158,15 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{
name: "employeeType",
align: "left",
label: "สถานภาพ",
field: "employeeType",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "type", name: "type",
align: "left", align: "left",
@ -165,10 +177,38 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "employeeType", name: "dateReceive",
align: "left", align: "left",
label: "สถานภาพ", label: "วันที่ได้รับพระราชทาน",
field: "employeeType", field: "dateReceive",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "date",
align: "left",
label: "วันที่ในราชกิจนุเบกษา",
field: "date",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "volumeNo",
align: "left",
label: "เล่มที่ในราชกิจนุเบกษา",
field: "volumeNo",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "section",
align: "left",
label: "ตอนที่ในราชกิจนุเบกษา",
field: "section",
sortable: true, sortable: true,
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),

View file

@ -22,6 +22,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
const typeReport = ref<string>(""); const typeReport = ref<string>("");
const titleReport = ref<string>(""); const titleReport = ref<string>("");
const mainTab = ref<string | undefined>('pending');
const setTypeandTitle = (type: string, title: string) => { const setTypeandTitle = (type: string, title: string) => {
typeReport.value = type; typeReport.value = type;
@ -110,6 +111,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
return { return {
optionsTypeOc, optionsTypeOc,
mainTab,
typeOc, typeOc,
rows, rows,
typeinsigniaOptions, typeinsigniaOptions,

View file

@ -14,6 +14,7 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
const insigniaType = ref<any>() const insigniaType = ref<any>()
const rows = ref<any>([]) const rows = ref<any>([])
const listInsignia = ref<any>([]) const listInsignia = ref<any>([])
const mainTab = ref<string>("")
const fetchDatainsignia = async (data: any) => { const fetchDatainsignia = async (data: any) => {
insignia.value = '' insignia.value = ''
@ -22,8 +23,10 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
insigniaOp.value.push({ name: e.name, id: e.id, type: e.insigniaType.id }) insigniaOp.value.push({ name: e.name, id: e.id, type: e.insigniaType.id })
}); });
} }
const fetchDatainsigniaType = async (data: any) => { const fetchDatainsigniaType = async (data: any,) => {
insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name })) insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
// mainTab.value = insigniaType.value[0].name
} }
const listinsignia = async (data: any) => { const listinsignia = async (data: any) => {
rows.value = []; rows.value = [];
@ -64,6 +67,7 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
listinsignia, listinsignia,
selectInsignia, selectInsignia,
profileType, profileType,
insigniaName insigniaName,
mainTab
}; };
}); });

View file

@ -40,6 +40,10 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
requestInsigniaId: e.requestInsigniaId, requestInsigniaId: e.requestInsigniaId,
employeeType: profileType(e.profileType), employeeType: profileType(e.profileType),
profileType: e.profileType, profileType: e.profileType,
dateReceive: (e.dateReceive),
date: date2Thai(e.date),
volumeNo: e.volumeNo,
section: e.section,
page: e.page, page: e.page,
number: e.no, number: e.no,
vatnumber: e.number, vatnumber: e.number,

View file

@ -47,6 +47,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
type: e.requestInsignia, type: e.requestInsignia,
employeeType: profileType(e.profileType), employeeType: profileType(e.profileType),
profileType: e.profileType, profileType: e.profileType,
date: date2Thai(e.date),
volumeNo: e.volumeNo, volumeNo: e.volumeNo,
section: e.section, section: e.section,
page: e.page, page: e.page,

View file

@ -94,6 +94,7 @@ const visibleColumns = ref<String[]>([
"name", "name",
"type", "type",
"dateReceive", "dateReceive",
"date",
"employeeType", "employeeType",
"volumeNo", "volumeNo",
"section", "section",
@ -169,10 +170,19 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{
name: "date",
align: "left",
label: "วันที่ในราชกิจนุเบกษา",
field: "date",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "volumeNo", name: "volumeNo",
align: "left", align: "left",
label: "เล่มในราชกิจนุเบกษา", label: "เล่มที่ในราชกิจนุเบกษา",
field: "volumeNo", field: "volumeNo",
sortable: true, sortable: true,
sort: (a: string, b: string) => sort: (a: string, b: string) =>
@ -181,7 +191,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "section", name: "section",
align: "left", align: "left",
label: "ตอนในราชกิจนุเบกษา", label: "ตอนที่ในราชกิจนุเบกษา",
field: "section", field: "section",
sortable: true, sortable: true,
sort: (a: string, b: string) => sort: (a: string, b: string) =>
@ -191,7 +201,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "page", name: "page",
align: "left", align: "left",
label: "หน้าในราชกิจนุเบกษา", label: "หน้าที่ในราชกิจนุเบกษา",
field: "page", field: "page",
sortable: true, sortable: true,
sort: (a: string, b: string) => sort: (a: string, b: string) =>