เครื่องราช เพิ่ม ()
This commit is contained in:
parent
c91ad3092d
commit
ff16be68f3
11 changed files with 120 additions and 74 deletions
|
|
@ -130,7 +130,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "insigniaType",
|
name: "insigniaType",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ประเภทเครื่องราชฯ ปัจจุบัน",
|
label: "ชั้นตราเครื่องราชฯ ปัจจุบัน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "insigniaType",
|
field: "insigniaType",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "insigniaType",
|
name: "insigniaType",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ประเภทเครื่องราชฯ ปัจจุบัน",
|
label: "ชั้นตราเครื่องราชฯ ปัจจุบัน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "insigniaType",
|
field: "insigniaType",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "insigniaType",
|
name: "insigniaType",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ประเภทเครื่องราชฯ ปัจจุบัน",
|
label: "ชั้นตราเครื่องราชฯ ปัจจุบัน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "insigniaType",
|
field: "insigniaType",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch,onMounted } from "vue";
|
import { ref, watch, onMounted } from "vue";
|
||||||
import { QForm, useQuasar } from "quasar";
|
import { QForm, useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import type { DataOption } from "@/modules/04_registry/components/profileType";
|
import type { DataOption } from "@/modules/04_registry/components/profileType";
|
||||||
|
import type { ItemType } from "@/modules/07_insignia/interface/request/Main";
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -32,8 +33,9 @@ const listPerson = ref<any>([]);
|
||||||
const OrgList = ref<DataOption[]>([]);
|
const OrgList = ref<DataOption[]>([]);
|
||||||
const filterOrgList = ref<any>([]);
|
const filterOrgList = ref<any>([]);
|
||||||
const insigniaNoteProfileId = ref<string>("");
|
const insigniaNoteProfileId = ref<string>("");
|
||||||
const filterSelectRound = ref<any>()
|
const filterSelectRound = ref<any>();
|
||||||
const selectRound = ref<any>()
|
const selectRound = ref<any>();
|
||||||
|
const type = ref<any>();
|
||||||
// เคลียร์ข้อมูลในฟอร์ม
|
// เคลียร์ข้อมูลในฟอร์ม
|
||||||
const clearData = () => {
|
const clearData = () => {
|
||||||
receivedate.value = null;
|
receivedate.value = null;
|
||||||
|
|
@ -79,10 +81,14 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
|
type: {
|
||||||
|
type: Array,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล
|
// เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
|
type.value = props.type;
|
||||||
if (props.modal == true && props.roundId != "all") {
|
if (props.modal == true && props.roundId != "all") {
|
||||||
roundNo.value = props.roundId;
|
roundNo.value = props.roundId;
|
||||||
fecthlistInsignia();
|
fecthlistInsignia();
|
||||||
|
|
@ -97,32 +103,31 @@ watch(props, () => {
|
||||||
|
|
||||||
// ดึงข้อมูลรายการเครื่องราช
|
// ดึงข้อมูลรายการเครื่องราช
|
||||||
const fecthlistInsignia = async () => {
|
const fecthlistInsignia = async () => {
|
||||||
if(roundNo.value !== ''&& roundNo.value !== null){
|
if (roundNo.value !== "" && roundNo.value !== null) {
|
||||||
showLoader();
|
showLoader();
|
||||||
let data = {
|
let data = {
|
||||||
insigniaTypeId: props.typeId,
|
insigniaTypeId: props.typeId,
|
||||||
insigniaNoteId: roundNo.value,
|
insigniaNoteId: roundNo.value,
|
||||||
insigniaId: "",
|
insigniaId: "",
|
||||||
};
|
};
|
||||||
await http
|
await http
|
||||||
.post(config.API.noteSearch(), data)
|
.post(config.API.noteSearch(), data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
listPerson.value = res.data.result;
|
listPerson.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
cardid.value = "";
|
cardid.value = "";
|
||||||
fullName.value = "";
|
fullName.value = "";
|
||||||
brand.value = "";
|
brand.value = "";
|
||||||
OrganazationId.value = "";
|
OrganazationId.value = "";
|
||||||
reason.value = "";
|
reason.value = "";
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// ดึงข้อมูลรายการหน่วยงาน
|
// ดึงข้อมูลรายการหน่วยงาน
|
||||||
const fetchOrgList = async () => {
|
const fetchOrgList = async () => {
|
||||||
|
|
@ -144,7 +149,7 @@ const fetchOrgList = async () => {
|
||||||
// ];
|
// ];
|
||||||
// } else {
|
// } else {
|
||||||
OrgList.value = orgArr;
|
OrgList.value = orgArr;
|
||||||
filterOrgList.value = OrgList.value
|
filterOrgList.value = OrgList.value;
|
||||||
// }
|
// }
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -222,7 +227,11 @@ const searchcardid = async () => {
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
fullName.value = `${node.prefix} ${node.fullName}`;
|
fullName.value = `${node.prefix} ${node.fullName}`;
|
||||||
brand.value = node.requestInsignia;
|
brand.value = `${node.requestInsignia} (${
|
||||||
|
type.value.find((item: any) => item.name === node.requestInsignia)
|
||||||
|
?.shortName || ""
|
||||||
|
})`;
|
||||||
|
insigniaNoteProfileId.value = node.id;
|
||||||
insigniaNoteProfileId.value = node.id;
|
insigniaNoteProfileId.value = node.id;
|
||||||
} else {
|
} else {
|
||||||
notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
|
notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
|
||||||
|
|
@ -252,28 +261,27 @@ const clearReturnDate = () => {
|
||||||
const filterSelector = (val: any, update: Function, name: any) => {
|
const filterSelector = (val: any, update: Function, name: any) => {
|
||||||
update(() => {
|
update(() => {
|
||||||
const needle = val.toLowerCase();
|
const needle = val.toLowerCase();
|
||||||
if (name === 'filterOrgList') {
|
if (name === "filterOrgList") {
|
||||||
OrganazationId.value = ''
|
OrganazationId.value = "";
|
||||||
filterOrgList.value = OrgList.value.filter(
|
filterOrgList.value = OrgList.value.filter(
|
||||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (name === 'filterSelectRoundOption') {
|
if (name === "filterSelectRoundOption") {
|
||||||
roundNo.value = ''
|
roundNo.value = "";
|
||||||
filterSelectRound.value = selectRound.value.filter(
|
filterSelectRound.value = selectRound.value.filter(
|
||||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
)
|
};
|
||||||
}
|
|
||||||
const setValue = () => {
|
const setValue = () => {
|
||||||
filterSelectRound.value = props.filterSelectRoundOption
|
filterSelectRound.value = props.filterSelectRoundOption;
|
||||||
selectRound.value = props.selectRoundOption
|
selectRound.value = props.selectRoundOption;
|
||||||
}
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setValue();
|
setValue();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const selectRoundOption = ref<OptionDataYear[]>([]);
|
||||||
const filterSelectRoundOption = ref<any>([]);
|
const filterSelectRoundOption = ref<any>([]);
|
||||||
const selectRoundAllOption = ref<OptionDataYear[]>([]);
|
const selectRoundAllOption = ref<OptionDataYear[]>([]);
|
||||||
const filterSelectRoundAllOption = ref<OptionDataYear[]>([]);
|
const filterSelectRoundAllOption = ref<OptionDataYear[]>([]);
|
||||||
|
const type = ref<any[]>(DataStore.type)
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const action = ref<string>("");
|
const action = ref<string>("");
|
||||||
const profileId = ref<string>("");
|
const profileId = ref<string>("");
|
||||||
|
|
@ -578,7 +578,7 @@ const clearInsigniaFilters = (name: string) => {
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
|
|
||||||
<DialogForm :modal="modal" :close="close" :close-and-fecth="closeAndFecth"
|
<DialogForm :modal="modal" :close="close" :close-and-fecth="closeAndFecth" :type="type"
|
||||||
:round-id="selectRound == '0' ? 'all' : selectRound" :action="action" :profile-id="profileId"
|
:round-id="selectRound == '0' ? 'all' : selectRound" :action="action" :profile-id="profileId"
|
||||||
v-model:selectRoundOption="selectRoundOption" v-model:filterSelectRoundOption="filterSelectRoundOption"
|
v-model:selectRoundOption="selectRoundOption" v-model:filterSelectRoundOption="filterSelectRoundOption"
|
||||||
:type-id="tab" />
|
:type-id="tab" />
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,8 @@ interface FormProprsalsRound2 {
|
||||||
period_doc: any;
|
period_doc: any;
|
||||||
period_status:any
|
period_status:any
|
||||||
}
|
}
|
||||||
export type { FormProprsalsRound, FormProprsalsRound2 };
|
interface ItemType {
|
||||||
|
name: string;
|
||||||
|
shortName: string;
|
||||||
|
}
|
||||||
|
export type { FormProprsalsRound, FormProprsalsRound2,ItemType };
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,9 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
level: e.rank,
|
level: e.rank,
|
||||||
salary: e.salary,
|
salary: e.salary,
|
||||||
salary2: Number(e.salary).toLocaleString(),
|
salary2: Number(e.salary).toLocaleString(),
|
||||||
insigniaType: e.lastInsignia,
|
insigniaType: e.lastInsignia ? `${e.lastInsignia} (${dataInsigniaType.value.find((item: any) => item.name === e.lastInsignia)?.shortName || ''})` : '',
|
||||||
insigniaSend: e.requestInsignia,
|
insigniaCheck: e.requestInsignia,
|
||||||
|
insigniaSend: e.requestInsignia ? `${e.requestInsignia} (${dataInsigniaType.value.find((item: any) => item.name === e.requestInsignia)?.shortName || ''})` : '',
|
||||||
insigniaLevel: e.level,
|
insigniaLevel: e.level,
|
||||||
dateSend: date2Thai(e.requestDate),
|
dateSend: date2Thai(e.requestDate),
|
||||||
requestNote: e.requestNote,
|
requestNote: e.requestNote,
|
||||||
|
|
@ -66,13 +67,24 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
isApprove: e.isApprove,
|
isApprove: e.isApprove,
|
||||||
statusMark:
|
statusMark:
|
||||||
e.markDiscipline === true ||
|
e.markDiscipline === true ||
|
||||||
e.markLeave === true ||
|
e.markLeave === true ||
|
||||||
e.markRate === true
|
e.markRate === true
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
}));
|
}));
|
||||||
|
const item = datalist
|
||||||
|
for (let j = 0; j < item.length; j++) {
|
||||||
|
const data = item[j];
|
||||||
|
const filteredData = dataInsigniaType.value.find((item: any) => item.name === data.insigniaType);
|
||||||
|
if (filteredData) {
|
||||||
|
data.insigniaType = `${data.insigniaType} (${filteredData.shortName})`;
|
||||||
|
} else {
|
||||||
|
data.insigniaType = data.insigniaType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rows.value = await datalist;
|
rows.value = await datalist;
|
||||||
listinsignia.value = await datalist;
|
listinsignia.value = await item;
|
||||||
searchDataTable(typeinsignia.value, employeeClass.value);
|
searchDataTable(typeinsignia.value, employeeClass.value);
|
||||||
filtertypeInsignia();
|
filtertypeInsignia();
|
||||||
} else rows.value = [];
|
} else rows.value = [];
|
||||||
|
|
@ -96,19 +108,23 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
// หาประเภทเครื่องราชทั้งหมดที่อยู่ในรายชื่อข้าราชการสามัญฯ
|
// หาประเภทเครื่องราชทั้งหมดที่อยู่ในรายชื่อข้าราชการสามัญฯ
|
||||||
const filtertypeInsignia = async () => {
|
const filtertypeInsignia = async () => {
|
||||||
typeinsignia.value = "all";
|
typeinsignia.value = "all";
|
||||||
|
|
||||||
if (listinsignia.value.length !== 0) {
|
if (listinsignia.value.length !== 0) {
|
||||||
// หาประเภทเครื่องราชที่ขอที่ชื่อซ้ำกัน
|
// หาประเภทเครื่องราชที่ขอที่ชื่อซ้ำกัน
|
||||||
const double_name = [
|
const double_name = [
|
||||||
...new Set(listinsignia.value.map((item: any) => item.insigniaSend)),
|
...new Set(listinsignia.value.map((item: any) => item.insigniaCheck)),
|
||||||
];
|
];
|
||||||
typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
|
typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
|
||||||
for (let i = 1; i <= double_name.length; i++) {
|
for (let i = 1; i <= double_name.length; i++) {
|
||||||
const type = double_name[i - 1];
|
const type = double_name[i - 1];
|
||||||
|
const filterShortName = dataInsigniaType.value.find((item: any) => item.name === type)
|
||||||
const listtype = {
|
const listtype = {
|
||||||
id: type,
|
id: type,
|
||||||
name: type,
|
name: `${type} (${filterShortName.shortName})`,
|
||||||
|
|
||||||
};
|
};
|
||||||
typeinsigniaOptions.value.push(listtype);
|
typeinsigniaOptions.value.push(listtype);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
|
} else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
|
||||||
};
|
};
|
||||||
|
|
@ -119,12 +135,12 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
if (type !== "all" && employeeClasstype !== "all") {
|
if (type !== "all" && employeeClasstype !== "all") {
|
||||||
rows.value = listinsignia.value.filter(
|
rows.value = listinsignia.value.filter(
|
||||||
(e: any) =>
|
(e: any) =>
|
||||||
e.insigniaSend === type &&
|
e.insigniaCheck === type &&
|
||||||
e.employeeType === profileType(employeeClasstype)
|
e.employeeType === profileType(employeeClasstype)
|
||||||
);
|
);
|
||||||
} else if (type !== "all" && employeeClasstype === "all") {
|
} else if (type !== "all" && employeeClasstype === "all") {
|
||||||
rows.value = listinsignia.value.filter(
|
rows.value = listinsignia.value.filter(
|
||||||
(e: any) => e.insigniaSend === type
|
(e: any) => e.insigniaCheck === type
|
||||||
);
|
);
|
||||||
} else if (type === "all" && employeeClasstype !== "all") {
|
} else if (type === "all" && employeeClasstype !== "all") {
|
||||||
rows.value = listinsignia.value.filter(
|
rows.value = listinsignia.value.filter(
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,18 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
|
||||||
const rows = ref<any>([])
|
const rows = ref<any>([])
|
||||||
const listInsignia = ref<any>([])
|
const listInsignia = ref<any>([])
|
||||||
const mainTab = ref<string>("")
|
const mainTab = ref<string>("")
|
||||||
|
const type = ref<any[]>([])
|
||||||
const fetchDatainsignia = async (data: any) => {
|
const fetchDatainsignia = async (data: any) => {
|
||||||
// insignia.value = ''
|
// insignia.value = ''
|
||||||
insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }]
|
insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }]
|
||||||
data.forEach((e: any) => {
|
data.forEach((e: any) => {
|
||||||
insigniaOp.value.push({ name: e.name, id: e.id, type: e.insigniaType.id })
|
insigniaOp.value.push({ name: `${e.name} (${e.shortName})`, id: e.id, type: e.insigniaType.id })
|
||||||
});
|
});
|
||||||
|
data.forEach((e: any) => {
|
||||||
|
type.value.push({
|
||||||
|
name:e.name,
|
||||||
|
shortName:e.shortName,
|
||||||
|
})})
|
||||||
}
|
}
|
||||||
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 }))
|
||||||
|
|
@ -34,7 +39,7 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
let list = await data.map((e: any) => ({
|
let list = await data.map((e: any) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
insignia: e.insignia,
|
insignia: `${e.insignia} (${type.value.find(item => item.name === e.insignia)?.shortName || ''})`,
|
||||||
insigniaId: e.insigniaId,
|
insigniaId: e.insigniaId,
|
||||||
total: e.total,
|
total: e.total,
|
||||||
allocate: e.allocate,
|
allocate: e.allocate,
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,18 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
||||||
const listInsignia = ref<any>([])
|
const listInsignia = ref<any>([])
|
||||||
const employeeClass = ref<string>("all");
|
const employeeClass = ref<string>("all");
|
||||||
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
|
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
|
||||||
|
const type = ref<any[]>([])
|
||||||
const fetchDataInsignia = async (data: any) => {
|
const fetchDataInsignia = async (data: any) => {
|
||||||
insignia.value = ''
|
insignia.value = ''
|
||||||
insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }]
|
insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }]
|
||||||
data.forEach((e: any) => {
|
data.forEach((e: any) => {
|
||||||
insigniaOp.value.push({ name: e.name, id: e.id, type: e.insigniaType.id })
|
insigniaOp.value.push({ name: `${e.name} (${e.shortName})`, id: e.id, type: e.insigniaType.id })
|
||||||
});
|
});
|
||||||
|
data.forEach((e: any) => {
|
||||||
|
type.value.push({
|
||||||
|
name:e.name,
|
||||||
|
shortName:e.shortName,
|
||||||
|
})})
|
||||||
}
|
}
|
||||||
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 }))
|
||||||
|
|
@ -36,7 +41,7 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
||||||
position: e.position,
|
position: e.position,
|
||||||
status: status(e.status),
|
status: status(e.status),
|
||||||
name: e.fullName,
|
name: e.fullName,
|
||||||
type: e.requestInsignia,
|
type: `${e.requestInsignia} (${type.value.find(item => item.name === e.requestInsignia)?.shortName || ''})`,
|
||||||
requestInsigniaId: e.requestInsigniaId,
|
requestInsigniaId: e.requestInsigniaId,
|
||||||
employeeType: profileType(e.profileType),
|
employeeType: profileType(e.profileType),
|
||||||
profileType: e.profileType,
|
profileType: e.profileType,
|
||||||
|
|
@ -109,5 +114,6 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
||||||
profileType,
|
profileType,
|
||||||
fetchlistinsignia,
|
fetchlistinsignia,
|
||||||
searchDatatable,
|
searchDatatable,
|
||||||
|
type
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
||||||
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "employee" }])
|
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "employee" }])
|
||||||
const rows = ref<any>([])
|
const rows = ref<any>([])
|
||||||
const listInsignia = ref<any>([])
|
const listInsignia = ref<any>([])
|
||||||
|
const type = ref<any[]>([])
|
||||||
|
|
||||||
const fetchDatainsignia = async (data: any) => {
|
const fetchDatainsignia = async (data: any) => {
|
||||||
insignia.value = ''
|
insignia.value = ''
|
||||||
|
|
@ -27,12 +27,18 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
||||||
insigniaOp.value = [{ name: "ทั้งหมด", id: "" }]
|
insigniaOp.value = [{ name: "ทั้งหมด", id: "" }]
|
||||||
insigniaOp2.value = []
|
insigniaOp2.value = []
|
||||||
data.forEach((e: any) => {
|
data.forEach((e: any) => {
|
||||||
insigniaOp.value.push({ name: e.name, id: e.id, insigniaType: e.insigniaType.id })
|
insigniaOp.value.push({ name: `${e.name} (${e.shortName})`, id: e.id, insigniaType: e.insigniaType.id })
|
||||||
});
|
});
|
||||||
data.forEach((e: any) => {
|
data.forEach((e: any) => {
|
||||||
insigniaOp2.value.push({ name: e.name, id: e.id })
|
insigniaOp2.value.push({ name: `${e.name} (${e.shortName})`, id: e.id })
|
||||||
});
|
});
|
||||||
}
|
data.forEach((e: any) => {
|
||||||
|
type.value.push({
|
||||||
|
name:e.name,
|
||||||
|
shortName:e.shortName,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
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 }))
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +52,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
||||||
status: status(e.status),
|
status: status(e.status),
|
||||||
dateReceive: date2Thai(e.dateReceive),
|
dateReceive: date2Thai(e.dateReceive),
|
||||||
name: e.prefix + e.fullName,
|
name: e.prefix + e.fullName,
|
||||||
type: e.requestInsignia,
|
type: `${e.requestInsignia} (${type.value.find(item => item.name === e.requestInsignia)?.shortName || ''})`,
|
||||||
employeeType: profileType(e.profileType),
|
employeeType: profileType(e.profileType),
|
||||||
profileType: e.profileType,
|
profileType: e.profileType,
|
||||||
date: date2Thai(e.date),
|
date: date2Thai(e.date),
|
||||||
|
|
|
||||||
|
|
@ -365,6 +365,7 @@ const addData = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const editData = (data: any) => {
|
const editData = (data: any) => {
|
||||||
|
|
||||||
personId.value = data.id;
|
personId.value = data.id;
|
||||||
profileType.value = data.profileType;
|
profileType.value = data.profileType;
|
||||||
action.value = "editData";
|
action.value = "editData";
|
||||||
|
|
@ -609,7 +610,7 @@ const clearInsigniaFilters = (name: string) => {
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
<div class="row col-12 q-pb-sm q-col-gutter-xs">
|
<div class="row col-12 q-pb-sm q-col-gutter-xs">
|
||||||
<q-select
|
<q-select
|
||||||
v-model="DataStore.insignia"
|
v-model="DataStore.insignia"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue