แก้ไข TAB เครื่องราชฯ ปรับ Table
This commit is contained in:
parent
b18056a335
commit
a1bd65f1ca
13 changed files with 87 additions and 10 deletions
|
|
@ -225,6 +225,7 @@ onMounted(async () => {
|
|||
"officer",
|
||||
props.tab
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ onMounted(async () => {
|
|||
"officer",
|
||||
props.tab
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
onMounted(async () => {
|
||||
|
||||
organizationOptions.value = DataStore.optionsTypeOc;
|
||||
organization.value = await (DataStore.agency != null
|
||||
? DataStore.agency
|
||||
|
|
@ -156,6 +157,7 @@ onMounted(async () => {
|
|||
"officer",
|
||||
props.tab
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ import { useQuasar } from "quasar";
|
|||
import type { QTableProps } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const DataStore = useInsigniaDataStore();
|
||||
const props = defineProps({
|
||||
roundId: {
|
||||
type: String,
|
||||
|
|
@ -44,6 +46,7 @@ const rows = ref<any[]>([]);
|
|||
|
||||
onMounted(async () => {
|
||||
await fecthOrg();
|
||||
DataStore.mainTab = props.tab;
|
||||
});
|
||||
watch(props, async () => {
|
||||
if (props.tab === "organization") {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const round = ref<string>("");
|
|||
const roundName = ref<string>("");
|
||||
const optionRound = ref<any>([]);
|
||||
const optiontypeOc = ref<any>([]);
|
||||
const tab = ref<any>("pending");
|
||||
const tab = ref<any>("");
|
||||
const stat = ref<any>({
|
||||
allUserUser: 0,
|
||||
orgAllCount: 0,
|
||||
|
|
@ -39,6 +39,7 @@ const stat = ref<any>({
|
|||
});
|
||||
|
||||
onMounted(async () => {
|
||||
tab.value = DataStore.mainTab;
|
||||
await checkRole();
|
||||
await fecthlistRound();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -408,6 +408,7 @@ const searchcardid = () => {
|
|||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:readonly="disbleStatus || status == 'DONE'"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
|
|
@ -495,6 +496,7 @@ const searchcardid = () => {
|
|||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:readonly="disbleStatus || status == 'DONE'"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
|
|
|
|||
|
|
@ -94,11 +94,16 @@ const fecthInsignia = async () => {
|
|||
};
|
||||
|
||||
const fecthInsigniaType = async () => {
|
||||
console.log(DataStore.mainTab);
|
||||
|
||||
await http(config.API.insigniaType)
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
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;
|
||||
fecthInsignia();
|
||||
})
|
||||
|
|
@ -177,6 +182,7 @@ const selectorRound = (round: string) => {
|
|||
};
|
||||
|
||||
const fecthlistInsignia = async () => {
|
||||
DataStore.mainTab = tab.value;
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaManageType(tab.value, Number(roundYear.value)))
|
||||
|
|
|
|||
|
|
@ -114,6 +114,9 @@ const visibleColumns = ref<String[]>([
|
|||
"name",
|
||||
"type",
|
||||
"employeeType",
|
||||
"date",
|
||||
"volumeNo",
|
||||
"section",
|
||||
"page",
|
||||
"number",
|
||||
"vatnumber",
|
||||
|
|
@ -155,6 +158,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
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",
|
||||
align: "left",
|
||||
|
|
@ -165,10 +177,38 @@ const columns = ref<QTableProps["columns"]>([
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "employeeType",
|
||||
name: "dateReceive",
|
||||
align: "left",
|
||||
label: "สถานภาพ",
|
||||
field: "employeeType",
|
||||
label: "วันที่ได้รับพระราชทาน",
|
||||
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,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
|
||||
const typeReport = ref<string>("");
|
||||
const titleReport = ref<string>("");
|
||||
const mainTab = ref<string | undefined>('pending');
|
||||
|
||||
const setTypeandTitle = (type: string, title: string) => {
|
||||
typeReport.value = type;
|
||||
|
|
@ -110,6 +111,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
|
||||
return {
|
||||
optionsTypeOc,
|
||||
mainTab,
|
||||
typeOc,
|
||||
rows,
|
||||
typeinsigniaOptions,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
|
|||
const insigniaType = ref<any>()
|
||||
const rows = ref<any>([])
|
||||
const listInsignia = ref<any>([])
|
||||
const mainTab = ref<string>("")
|
||||
|
||||
const fetchDatainsignia = async (data: any) => {
|
||||
insignia.value = ''
|
||||
|
|
@ -22,8 +23,10 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
|
|||
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 }))
|
||||
// mainTab.value = insigniaType.value[0].name
|
||||
|
||||
}
|
||||
const listinsignia = async (data: any) => {
|
||||
rows.value = [];
|
||||
|
|
@ -64,6 +67,7 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
|
|||
listinsignia,
|
||||
selectInsignia,
|
||||
profileType,
|
||||
insigniaName
|
||||
insigniaName,
|
||||
mainTab
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
|||
requestInsigniaId: e.requestInsigniaId,
|
||||
employeeType: profileType(e.profileType),
|
||||
profileType: e.profileType,
|
||||
dateReceive: (e.dateReceive),
|
||||
date: date2Thai(e.date),
|
||||
volumeNo: e.volumeNo,
|
||||
section: e.section,
|
||||
page: e.page,
|
||||
number: e.no,
|
||||
vatnumber: e.number,
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
|||
type: e.requestInsignia,
|
||||
employeeType: profileType(e.profileType),
|
||||
profileType: e.profileType,
|
||||
date: date2Thai(e.date),
|
||||
volumeNo: e.volumeNo,
|
||||
section: e.section,
|
||||
page: e.page,
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ const visibleColumns = ref<String[]>([
|
|||
"name",
|
||||
"type",
|
||||
"dateReceive",
|
||||
"date",
|
||||
"employeeType",
|
||||
"volumeNo",
|
||||
"section",
|
||||
|
|
@ -169,10 +170,19 @@ const columns = ref<QTableProps["columns"]>([
|
|||
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: "เล่มในราชกิจนุเบกษา",
|
||||
label: "เล่มที่ในราชกิจนุเบกษา",
|
||||
field: "volumeNo",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -181,7 +191,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "section",
|
||||
align: "left",
|
||||
label: "ตอนในราชกิจนุเบกษา",
|
||||
label: "ตอนที่ในราชกิจนุเบกษา",
|
||||
field: "section",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -191,7 +201,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "page",
|
||||
align: "left",
|
||||
label: "หน้าในราชกิจนุเบกษา",
|
||||
label: "หน้าที่ในราชกิจนุเบกษา",
|
||||
field: "page",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue