Merge branch 'develop' into devTee
This commit is contained in:
commit
36d0c61b25
16 changed files with 162 additions and 143 deletions
|
|
@ -22,8 +22,10 @@ export default {
|
|||
insigniaPeriodId: any,
|
||||
ocId: string,
|
||||
role: string,
|
||||
status: any
|
||||
) => `${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}`,
|
||||
status: any,
|
||||
isDeputy: boolean = false
|
||||
) =>
|
||||
`${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}/${isDeputy}`,
|
||||
insigniaReject: (profileId: string) =>
|
||||
`${insignia}/request/status/reject/${profileId}`,
|
||||
insigniaDelete: (profileId: string) =>
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ interface DataStructureTree {
|
|||
children: DataStructureTree[];
|
||||
orgRootCode: string;
|
||||
orgRootShortName: string;
|
||||
isDeputy?: boolean;
|
||||
}
|
||||
|
||||
interface DataStrategy {
|
||||
|
|
|
|||
|
|
@ -283,6 +283,8 @@ async function getData() {
|
|||
if (res.data.result.birthDate) {
|
||||
// กำหนดอายุ ส่งวันเกิดไปคำนวน
|
||||
age.value = calculateAge(res.data.result.birthDate);
|
||||
} else {
|
||||
age.value = null;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
|
|
@ -78,9 +78,11 @@ const baseColumns = ref<QTableColumn[]>([
|
|||
sortable: true,
|
||||
field: "startDate",
|
||||
format(val, row) {
|
||||
return row.isDate
|
||||
? date2Thai(row.startDate)
|
||||
: (new Date(row.startDate).getFullYear() + 543).toString();
|
||||
return row.startDate
|
||||
? row.isDate
|
||||
? date2Thai(row.startDate)
|
||||
: (new Date(row.startDate).getFullYear() + 543).toString()
|
||||
: "-";
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -94,9 +96,11 @@ const baseColumns = ref<QTableColumn[]>([
|
|||
sortable: true,
|
||||
field: "endDate",
|
||||
format(val, row) {
|
||||
return row.isDate
|
||||
? date2Thai(row.endDate)
|
||||
: (new Date(row.endDate).getFullYear() + 543).toString();
|
||||
return row.endDate
|
||||
? row.isDate
|
||||
? date2Thai(row.endDate)
|
||||
: (new Date(row.endDate).getFullYear() + 543).toString()
|
||||
: "-";
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, computed, reactive, watch } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useQuasar, QForm, is } from "quasar";
|
||||
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -77,6 +77,7 @@ const modalEdit = ref<boolean>(false); //popup แก้ไขเครื่อ
|
|||
const modalPersonal = ref<boolean>(false); //popup ข้อมูลราชการ
|
||||
const rowid = ref<string>(""); // id ที่ต้องการ
|
||||
const organization = ref<string>(""); //หน่วยงาน
|
||||
const isDeputy = ref<boolean>(false); //เลือกสำนักปลัดหรือไม่
|
||||
|
||||
/** หมายเหตุ*/
|
||||
const dialogNote = ref<boolean>(false); //หมายเหตุ
|
||||
|
|
@ -307,7 +308,11 @@ const person = ref<DataManageList>();
|
|||
/** เช็คสถานนะแสดงปุ่มเพิ่ม*/
|
||||
const checkStatus = computed(() => {
|
||||
if (
|
||||
DataStore.isStaff &&
|
||||
((DataStore.isOfficer &&
|
||||
DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1) ||
|
||||
DataStore.isStaff) &&
|
||||
(DataStore.requestStatus == "st1" || DataStore.requestStatus == "st4")
|
||||
) {
|
||||
return true;
|
||||
|
|
@ -315,13 +320,17 @@ const checkStatus = computed(() => {
|
|||
});
|
||||
|
||||
/** เลือกหน่วยงาน*/
|
||||
function changtypeOc() {
|
||||
async function changtypeOc() {
|
||||
if (organization.value !== null) {
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
props.fecthInsigniaByOc?.(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
}
|
||||
DataStore.typeOc = organization.value;
|
||||
|
|
@ -441,7 +450,8 @@ async function addlistperson(id: string) {
|
|||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
}
|
||||
modalAdd.value = false;
|
||||
|
|
@ -536,7 +546,8 @@ async function clickSave() {
|
|||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
success($q, "แก้ไขเครื่องราชฯ ที่ยื่นขอสำเร็จ");
|
||||
modalEdit.value = false;
|
||||
|
|
@ -589,7 +600,8 @@ async function listreject(profileId: string, reason: string) {
|
|||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
@ -646,7 +658,8 @@ async function listdelete(id: string, reason: string) {
|
|||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closemodelPopupDelete();
|
||||
|
|
@ -837,9 +850,10 @@ function clearInsigniaFilters(name: string) {
|
|||
|
||||
watch(
|
||||
() => DataStore.typeOc,
|
||||
async () => {
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = await DataStore.typeOc;
|
||||
() => {
|
||||
filterOrganizationOP.value = DataStore.optionsTypeOc;
|
||||
organization.value = DataStore.typeOc;
|
||||
DataStore.selectOrganization = DataStore.typeOc;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -881,14 +895,20 @@ function onClickViewInfo(type: string, id: string, empClass: string) {
|
|||
onMounted(async () => {
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = DataStore.typeOc;
|
||||
DataStore.selectOrganization = DataStore.typeOc;
|
||||
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { onMounted, ref, watch } from "vue";
|
|||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
import { useroleUserDataStore } from "@/stores/roleUser";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** import Type*/
|
||||
|
|
@ -17,7 +16,6 @@ import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
|||
const mixin = useCounterMixin();
|
||||
const { onSearchDataTable } = mixin;
|
||||
/** useStore*/
|
||||
const roleDataStore = useroleUserDataStore();
|
||||
const DataStore = useInsigniaDataStore();
|
||||
const props = defineProps({
|
||||
tab: {
|
||||
|
|
@ -38,6 +36,7 @@ const organization = ref<string>("1");
|
|||
const filterOrganizationOP = ref<OptionData[]>([]); //หน่วยงาน
|
||||
const typeinsigniaOptions = ref<OptionData[]>(DataStore.typeinsigniaOptions); //ประเภทเครื่องราย
|
||||
const employeeClassOps = ref<OptionData[]>(DataStore.employeeClassOps); //ประเภทข้ารายกาช
|
||||
const isDeputy = ref<boolean>(false); //เลือกสำนักปลัดหรือไม่
|
||||
|
||||
/** หัวตาราง*/
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -156,13 +155,18 @@ const visibleColumns = ref<string[]>([
|
|||
]);
|
||||
|
||||
/** function เลือกหน่วยงาน */
|
||||
function changtypeOc() {
|
||||
async function changtypeOc() {
|
||||
if (organization.value !== null) {
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc?.(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
}
|
||||
DataStore.typeOc = organization.value;
|
||||
|
|
@ -265,14 +269,20 @@ function onSearch() {
|
|||
/*** Hook*/
|
||||
onMounted(async () => {
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = await DataStore.typeOc;
|
||||
organization.value = DataStore.typeOc;
|
||||
DataStore.selectOrganization = DataStore.typeOc;
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
|
|
@ -284,6 +294,7 @@ watch(
|
|||
async () => {
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = await DataStore.typeOc;
|
||||
DataStore.selectOrganization = DataStore.typeOc;
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ const typeinsigniaOptions = ref<OptionData[]>(DataStore.typeinsigniaOptions); //
|
|||
const employeeClassOps = ref<OptionData[]>(DataStore.employeeClassOps); //ประเภทข้ารายกาช
|
||||
const filterOrganizationOP = ref<OptionData[]>([]); // //หน่วยงาน
|
||||
const organization = ref<string>("1");
|
||||
const organizationOptions = ref<OptionData[]>([{ id: "1", name: "ทั้งหมด" }]);
|
||||
const isDeputy = ref<boolean>(false); //เลือกสำนักปลัดหรือไม่
|
||||
|
||||
/** หัวตาราง*/
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -158,11 +158,16 @@ const visibleColumns = ref<string[]>([
|
|||
/** function เลือกหน่วยงาน */
|
||||
async function changtypeOc() {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
}
|
||||
DataStore.typeOc = organization.value;
|
||||
|
|
@ -266,22 +271,29 @@ function onSearch() {
|
|||
watch(
|
||||
() => DataStore.typeOc,
|
||||
async () => {
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = await DataStore.typeOc;
|
||||
filterOrganizationOP.value = DataStore.optionsTypeOc;
|
||||
organization.value = DataStore.typeOc;
|
||||
DataStore.selectOrganization = DataStore.typeOc;
|
||||
}
|
||||
);
|
||||
|
||||
/** Hook*/
|
||||
onMounted(async () => {
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = await DataStore.typeOc;
|
||||
filterOrganizationOP.value = DataStore.optionsTypeOc;
|
||||
organization.value = DataStore.typeOc;
|
||||
DataStore.selectOrganization = DataStore.typeOc;
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
interface OptionData {
|
||||
id: string | number;
|
||||
name: string;
|
||||
isDeputy?: boolean;
|
||||
}
|
||||
|
||||
interface OptionDataList {
|
||||
id:string
|
||||
id: string;
|
||||
val: string | number;
|
||||
name: string;
|
||||
}
|
||||
|
|
@ -233,5 +234,5 @@ export type {
|
|||
Pagination,
|
||||
DataManageList,
|
||||
ResOrg,
|
||||
OptionDataList
|
||||
OptionDataList,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
const isOfficer = ref<boolean>(false);
|
||||
const isStaff = ref<boolean>(false);
|
||||
const isDirector = ref<boolean>(false);
|
||||
const isDeputy = ref<boolean>(false);
|
||||
const selectOrganization = ref<string>("");
|
||||
|
||||
/** option รายงาน */
|
||||
const optionReport = ref<OptionReport[]>([
|
||||
|
|
@ -285,5 +287,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
isStaff,
|
||||
isOfficer,
|
||||
isDirector,
|
||||
isDeputy,
|
||||
selectOrganization,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ const {
|
|||
const rows = ref<FormProprsalsRound2[]>([]); //รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
const rowsData = ref<FormProprsalsRound2[]>([]); //รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
const filterKeyword = ref<string>(""); //คำค้นหาข้อมูลในตาราง
|
||||
const filterRef = ref<HTMLInputElement | null>(null);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "period_name",
|
||||
|
|
@ -103,9 +102,7 @@ const modalForm = ref<boolean>(false); //แสดงรายละเอีย
|
|||
const actionType = ref<string>(""); // ประเภท ดูรายละเอียด,แก้ไข
|
||||
const roundId = ref<string>(""); //id ที่ต้องการ ดูรายละเอียด,แก้ไข
|
||||
|
||||
/**
|
||||
* Function เรียกรายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
*/
|
||||
/** Function เรียกรายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์*/
|
||||
async function fetchData() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -149,7 +146,7 @@ function clickDelete(id: string) {
|
|||
.delete(config.API.RoundInsignia(id))
|
||||
.then(async () => {
|
||||
await fetchData();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -160,16 +157,6 @@ function clickDelete(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Function กำหนดค่า filterKeyword เป็นค่าว่าง
|
||||
*/
|
||||
function resetFilter() {
|
||||
filterKeyword.value = "";
|
||||
if (filterRef.value) {
|
||||
filterRef.value.focus();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function ดูข้อมูลรายละเอียดรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
* @param action ประเภท ดูรายละเอียด,แก้ไข
|
||||
|
|
@ -189,9 +176,7 @@ function onSearch() {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อ Componenets ถูกเรียกใช้งาน
|
||||
*/
|
||||
/** ทำงานเมื่อ Componenets ถูกเรียกใช้งาน*/
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
|
@ -201,6 +186,7 @@ onMounted(async () => {
|
|||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</div>
|
||||
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
|
|
@ -222,7 +208,6 @@ onMounted(async () => {
|
|||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
|||
* ตัวแปร
|
||||
*/
|
||||
const loadview = ref<boolean>(false); //แสดง View
|
||||
const hideBottom = ref<boolean>(false);
|
||||
// const hideBottom = ref<boolean>(false);
|
||||
const round = ref<string>(""); //รอยการเสนอขอ
|
||||
const roundName = ref<string>(""); //ชื่อรอบการเสนอ
|
||||
const optionRound = ref<OptionRound[]>([]);
|
||||
|
|
@ -133,6 +133,7 @@ async function fetchListOrg(id: string) {
|
|||
(item: DataStructureTree) => ({
|
||||
id: item.orgTreeId,
|
||||
name: item.orgName,
|
||||
isDeputy: item.isDeputy,
|
||||
})
|
||||
);
|
||||
|
||||
|
|
@ -157,6 +158,7 @@ async function fecthAgency(id: string) {
|
|||
})
|
||||
.then((res) => {
|
||||
DataStore.agency = res.data.result.rootId;
|
||||
DataStore.selectOrganization = res.data.result.rootId;
|
||||
DataStore.typeOc = DataStore.agency;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -189,6 +191,7 @@ async function fetchCheckIsofficer() {
|
|||
DataStore.isStaff = data.isStaff;
|
||||
DataStore.isOfficer = data.isOfficer;
|
||||
DataStore.isDirector = data.isDirector;
|
||||
DataStore.isDeputy = data.isDeputy;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -231,13 +234,14 @@ async function fecthInsigniaByOc(
|
|||
roundId: string,
|
||||
ocId: string,
|
||||
role: string,
|
||||
status: string
|
||||
status: string,
|
||||
isDeputy: boolean = false
|
||||
) {
|
||||
DataStore.rows = [];
|
||||
if (roundId && ocId && role && status) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaList(roundId, ocId, role, status))
|
||||
.get(config.API.insigniaList(roundId, ocId, role, status, isDeputy))
|
||||
.then(async (res) => {
|
||||
requestNote.value = res.data.result.requestNote;
|
||||
requestStatus.value = res.data.result.requestStatus;
|
||||
|
|
@ -246,11 +250,11 @@ async function fecthInsigniaByOc(
|
|||
await DataStore.fetchData(res.data.result.items); // ส่งรายชื่อข้าราชการสามัญฯ
|
||||
await DataStore.fetchDataInsignia(res.data.result); // ส่งข้อมูลรอบบการแสดง
|
||||
// แสดงปุมล็อกข้อมูล
|
||||
if (res.data.result.items !== null) {
|
||||
if (res.data.result.items.length !== 0) {
|
||||
hideBottom.value = true;
|
||||
} else hideBottom.value = false;
|
||||
}
|
||||
// if (res.data.result.items !== null) {
|
||||
// if (res.data.result.items.length !== 0) {
|
||||
// hideBottom.value = true;
|
||||
// } else hideBottom.value = false;
|
||||
// }
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -493,7 +497,6 @@ onUnmounted(() => {
|
|||
v-if="
|
||||
DataStore.isOfficer &&
|
||||
DataStore.isLock !== true &&
|
||||
hideBottom &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
dense
|
||||
|
|
@ -555,7 +558,7 @@ onUnmounted(() => {
|
|||
>
|
||||
<div
|
||||
v-if="
|
||||
(DataStore.isStaff && requestStatus == 'st4') ||
|
||||
(((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex((v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) && requestStatus == 'st4') ||
|
||||
(DataStore.isDirector && requestStatus == 'st5')
|
||||
"
|
||||
class="q-pa-md q-gutter-sm"
|
||||
|
|
@ -633,7 +636,7 @@ onUnmounted(() => {
|
|||
|
||||
<q-toolbar class="q-py-md text-right">
|
||||
<q-file
|
||||
v-if="DataStore.isStaff && checkPermission($route)?.attrIsUpdate"
|
||||
v-if="((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex((v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) && checkPermission($route)?.attrIsUpdate"
|
||||
bg-color="white"
|
||||
clearable
|
||||
outlined
|
||||
|
|
@ -664,7 +667,7 @@ onUnmounted(() => {
|
|||
flat
|
||||
round
|
||||
color="primary"
|
||||
v-if="DataStore.isStaff && checkPermission($route)?.attrIsGet"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
:href="document"
|
||||
target="_blank"
|
||||
>
|
||||
|
|
@ -683,9 +686,11 @@ onUnmounted(() => {
|
|||
>
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
DataStore.isStaff &&
|
||||
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
|
||||
(requestStatus == 'st1' || requestStatus == 'st4') &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
|
|
|
|||
|
|
@ -220,7 +220,6 @@ const isEdit = ref<boolean>(false); // สถานะการแก้ไข
|
|||
const insigniaReclaimId = ref<string>(""); // ID รายการเรียกคืนเครื่องราชฯ
|
||||
const insigniaReclaimData = ref<DataReclaim>(); //ข้อมูลรายการเรียกคืนเครื่องราชฯ
|
||||
|
||||
|
||||
const yearRound = ref<number>(); //รอบการเสนอขอ
|
||||
const insigniaType = ref<string>("all"); //ประเภทเครื่องราช
|
||||
const employeeType = ref<string>("all"); //ตำแหน่งประเภม
|
||||
|
|
@ -234,8 +233,8 @@ async function fetchInsigniaRound() {
|
|||
let data = res.data.result;
|
||||
roundData.value.push(...data);
|
||||
roundOps.value = roundData.value;
|
||||
yearRound.value = data[0].year;
|
||||
if (data.length > 0) {
|
||||
yearRound.value = data[0].year;
|
||||
isInsigniaRound.value = true;
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from "vue";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
|
|
@ -49,18 +49,18 @@ const router = useRouter();
|
|||
const route = useRoute();
|
||||
const paramsId = route.params.id.toString();
|
||||
|
||||
const keycloakId = ref<string>("");
|
||||
const myProfileId = ref<string>("");
|
||||
const typeDocx = ref<string>("docx");
|
||||
const typePdf = ref<string>("pdf");
|
||||
const modalApprove = ref(false);
|
||||
const dialogTitle = ref<string>("อนุญาต");
|
||||
const approveCheck = computed(() => {
|
||||
return (
|
||||
rows.value?.commanders?.every(
|
||||
(commander) => commander.approveStatus === "APPROVE"
|
||||
) ?? false
|
||||
);
|
||||
});
|
||||
// const approveCheck = computed(() => {
|
||||
// return (
|
||||
// rows.value?.commanders?.every(
|
||||
// (commander) => commander.approveStatus === "APPROVE"
|
||||
// ) ?? false
|
||||
// );
|
||||
// });
|
||||
|
||||
/** ฟังก์ชั่น อัปโหลด
|
||||
* consolelog ไว้ก่อน
|
||||
|
|
@ -470,12 +470,12 @@ async function checkOfficer() {
|
|||
}
|
||||
|
||||
async function fetchKeycloakPosition() {
|
||||
if (keycloakId.value == "") {
|
||||
if (myProfileId.value == "") {
|
||||
await http
|
||||
.get(config.API.keycloakPosition())
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
keycloakId.value = data.profileId;
|
||||
myProfileId.value = data.profileId;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -830,23 +830,17 @@ async function fetchKeycloakPosition() {
|
|||
</div>
|
||||
<q-separator
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
formData.reasonOligarch === '-' &&
|
||||
rows &&
|
||||
rows.approvers[0]?.profileId == keycloakId &&
|
||||
rows.approvers[0]?.approveStatus == 'PENDING' &&
|
||||
approveCheck
|
||||
rows.approvers[0]?.profileId == myProfileId &&
|
||||
rows.approvers[0]?.approveStatus == 'PENDING'
|
||||
"
|
||||
/>
|
||||
<div
|
||||
class="row q-pa-md q-gutter-sm justify-end"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
formData.reasonOligarch === '-' &&
|
||||
rows &&
|
||||
rows.approvers[0]?.profileId == keycloakId &&
|
||||
rows.approvers[0]?.approveStatus == 'PENDING' &&
|
||||
approveCheck
|
||||
rows.approvers[0]?.profileId == myProfileId &&
|
||||
rows.approvers[0]?.approveStatus == 'PENDING'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
|
|
|
|||
|
|
@ -238,24 +238,6 @@ function updatePagination(newPagination: any) {
|
|||
pagination.value.rowsPerPage = newPagination.rowsPerPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* แปลง สถานะ เป็น text
|
||||
* @param val
|
||||
*/
|
||||
function convert(val: any) {
|
||||
const filtertype = props.dataToobar?.find(
|
||||
(e: any) => e.id === val.leaveTypeId
|
||||
);
|
||||
const type = filtertype?.code;
|
||||
if (type == "LV-006" && val.hajjDayStatus == false) {
|
||||
return "ลาอุปสมบท";
|
||||
} else if (type == "LV-006" && val.hajjDayStatus == true) {
|
||||
return "ลาประกอบพิธีฮัจญ์";
|
||||
} else {
|
||||
return val.leaveTypeName;
|
||||
}
|
||||
}
|
||||
|
||||
/** Hook*/
|
||||
onMounted(() => {
|
||||
if (leaveStore.tabMenu === "1") {
|
||||
|
|
@ -306,7 +288,23 @@ onMounted(() => {
|
|||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props" :class="props.row.statusText == 'REJECT' || props.row.statusText == 'DELETE' ? 'text-red':props.row.statusText == 'PENDING' ? 'text-orange':props.row.statusText == 'APPROVE' ? 'text-green':''">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
:class="
|
||||
props.row.statusText == 'REJECT'
|
||||
? 'text-red'
|
||||
: props.row.statusText == 'NEW'
|
||||
? 'text-blue'
|
||||
: props.row.statusText == 'PENDING'
|
||||
? 'text-warning'
|
||||
: props.row.statusText == 'DELETE' ||
|
||||
props.row.statusText == 'DELETING'
|
||||
? 'text-orange'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{
|
||||
(pagination.page - 1) * pagination.rowsPerPage +
|
||||
|
|
@ -315,7 +313,15 @@ onMounted(() => {
|
|||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'leaveTypeName'">
|
||||
{{ props.row.leaveTypeName ? `${props.row.leaveTypeName} ${props.row.leaveSubTypeName ? `(${props.row.leaveSubTypeName})`:''}`: '-' }}
|
||||
{{
|
||||
props.row.leaveTypeName
|
||||
? `${props.row.leaveTypeName} ${
|
||||
props.row.leaveSubTypeName
|
||||
? `(${props.row.leaveSubTypeName})`
|
||||
: ""
|
||||
}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'profileType'">
|
||||
{{
|
||||
|
|
|
|||
|
|
@ -131,8 +131,10 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
|||
return "อนุญาต";
|
||||
case "REJECT":
|
||||
return "ไม่อนุญาต";
|
||||
case "DELETING":
|
||||
return "กำลังดำเนินการยกเลิก";
|
||||
case "DELETE":
|
||||
return "ยกเลิก";
|
||||
return "ยกเลิกสำเร็จ";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import type {
|
|||
optionType,
|
||||
} from "../interface/request/main/main";
|
||||
import { tabList, tabListPlacement } from "../interface/request/main/main";
|
||||
import { useroleUserDataStore } from "@/stores/roleUser";
|
||||
|
||||
import LoginLinkage from "@/components/LoginLinkage.vue";
|
||||
|
||||
|
|
@ -41,9 +40,6 @@ const {
|
|||
date2Thai,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const DataStore = useroleUserDataStore();
|
||||
const { fetchroleUser } = DataStore;
|
||||
|
||||
const $q = useQuasar();
|
||||
const { tabData, loader } = storeToRefs(store);
|
||||
const { changeTab } = store;
|
||||
|
|
@ -51,34 +47,12 @@ const miniState = ref<boolean>(true);
|
|||
const drawerR = ref<boolean>(false);
|
||||
const rightActive = ref<boolean>(false);
|
||||
const resize = ref<number>(0);
|
||||
const active = ref<number>(0);
|
||||
const drawerL = ref<boolean>(false);
|
||||
const fullname = ref<string>("");
|
||||
const role = ref<string[]>([]);
|
||||
const notiTrigger = ref<boolean>(false);
|
||||
const text = ref<string>("");
|
||||
|
||||
const notiList = ref<notiType[]>([]);
|
||||
const options = ref<optionType[]>([
|
||||
{
|
||||
icon: "mdi-account-cog",
|
||||
label: "ผู้ดูแลระบบ",
|
||||
value: "op1",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
icon: "mdi-account-group",
|
||||
label: "เจ้าหน้าที่",
|
||||
value: "op2",
|
||||
color: "blue",
|
||||
},
|
||||
{
|
||||
icon: "mdi-account-circle",
|
||||
label: "บุคคล",
|
||||
value: "op3",
|
||||
color: "indigo",
|
||||
},
|
||||
]);
|
||||
const modalLoginLinkage = ref<boolean>(false); //เข้าสู่ระบบ Linkage Center
|
||||
|
||||
// landing page redirect
|
||||
|
|
@ -252,9 +226,6 @@ onMounted(async () => {
|
|||
isSsoToken.value = SSO_TOKEN === "y" ? true : false;
|
||||
if (user) {
|
||||
fullname.value = user.name;
|
||||
role.value = user.role;
|
||||
|
||||
await fetchroleUser(user.role);
|
||||
}
|
||||
|
||||
fetchmsgNoread();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue