รายการลาออก

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-05-23 17:36:55 +07:00
parent 045bd3aee6
commit 474a856eb0
11 changed files with 285 additions and 165 deletions

View file

@ -4,6 +4,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
import type { PropType } from "vue";
import type { QTableProps } from "quasar";
@ -15,6 +16,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
/** use */
const $q = useQuasar();
const stroe = useRetirementDataStore();
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
const { statusText } = stroe;
const selected = ref<ResponseItems[]>([]);
const dataMapToSend = computed(() => {
@ -33,7 +35,7 @@ const dataMapToSend = computed(() => {
}));
});
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
const { dialogConfirm, date2Thai, onSearchDataTable, messageError } = mixin;
/** props*/
const props = defineProps({
@ -54,7 +56,7 @@ const columns = ref<QTableProps["columns"]>([
align: "left",
label: "ลำดับ",
sortable: false,
field: (row) => props?.rows!.indexOf(row) + 1,
field: (row) => rowsData.value!.indexOf(row) + 1,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
@ -190,13 +192,36 @@ async function onSearch() {
);
}
const isOfficer = ref<boolean>(false);
const isStaff = ref<boolean>(false);
/** ฟังก์ดึงข้อมูลผู้บังคับบัญชา*/
async function fetchCheckOfficer() {
try {
const data = await fetchDataCheckIsoffice("SYS_RESIGN");
isOfficer.value = data.isOfficer;
isStaff.value = data.isStaff;
} catch (err) {
messageError($q, err);
}
}
watch(
() => props.modal,
(val) => {
async (val) => {
if (val) {
selected.value = [];
rowsData.value = props.rows ? props.rows : [];
rowsDataMain.value = props.rows ? props.rows : [];
await fetchCheckOfficer();
const data = props?.rows?.filter((e: any) => {
if (isStaff.value) {
return e.group === "1.1";
} else {
return e.group !== "1.1";
}
});
rowsData.value = data ? data : [];
rowsDataMain.value = data ? data : [];
} else {
rowsData.value = [];
rowsDataMain.value = [];